-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwebpack.dev.js
32 lines (32 loc) · 1005 Bytes
/
webpack.dev.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
const merge = require( 'webpack-merge' );
const WebpackAssetsManifest = require( 'webpack-assets-manifest' );
const path = require( 'path' );
const webpack = require( 'webpack' );
const common = require( './webpack.common.js' );
const CleanWebpackPlugin = require( 'clean-webpack-plugin' );
const miniExtract = require( 'mini-css-extract-plugin' );
const assetsData = Object.create( null );
common.forEach( ( config, index ) => {
common[ index ] = merge( config, {
devtool: 'inline-source-map',
plugins: [
new CleanWebpackPlugin( [ 'assets/dist' ] ),
new WebpackAssetsManifest( {
output: path.resolve( __dirname,
'assets/dist/build-manifest.json',
),
assets: assetsData,
} ),
new webpack.ProvidePlugin( {
React: 'react',
} ),
new miniExtract( {
filename: 'ee-[name].[contenthash].dist.css',
} ),
],
mode: 'development',
} );
//delete temporary named config item so no config errors
delete common[ index ].configName;
} );
module.exports = common;