Skip to main content

Webpack driver

Provides Webpack support by dynamically generating a webpack.config.js config file.

Requirements#

  • Webpack ^4.0.0 || ^5.0.0

Installation#

In your configuration module, install the driver, Webpack, and any loaders or plugins.

yarn add @beemo/driver-webpack webpack webpack-cli

Create a file at configs/webpack.ts (or js) in which to house your Webpack configuration.

configs/webpack.ts
import { WebpackConfig } from '@beemo/driver-webpack';
import path from 'path';
const config: WebpackConfig = {{
entry: './src/index.js',
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'bundle.js',
},
}
// ...
};
export default config;

Integration#

In your consuming project, enable the driver by adding webpack to your drivers config.

.config/beemo.ts
import { BeemoConfig } from '@beemo/core';
const config: BeemoConfig = {
module: '<config-module>',
drivers: ['webpack'],
};
export default config;