-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathwebpack.demo.js
More file actions
30 lines (28 loc) · 881 Bytes
/
webpack.demo.js
File metadata and controls
30 lines (28 loc) · 881 Bytes
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
const webpack = require('webpack');
const merge = require('webpack-merge');
const Dotenv = require('dotenv-webpack');
const CopyWebpackPlugin = require('copy-webpack-plugin');
const common = require('./webpack.common.js');
module.exports = (env) => {
const commonConfig = common(env);
return merge(commonConfig, {
mode: 'development',
devtool: 'source-map',
plugins: [
...commonConfig.plugins,
new CopyWebpackPlugin([
{ from: 'icon16.png', to: 'icon16.png' },
{ from: 'icon48.png', to: 'icon48.png' },
{ from: 'icon128.png', to: 'icon128.png' },
{ from: 'content.js', to: 'content.js' },
{ from: 'staging.manifest.json', to: 'manifest.json' },
]),
new webpack.optimize.LimitChunkCountPlugin({
maxChunks: 1,
}),
new Dotenv({
path: './.env.demo',
}),
],
});
};