-
Notifications
You must be signed in to change notification settings - Fork 54
/
Copy pathwebpack.config.js
41 lines (37 loc) · 889 Bytes
/
webpack.config.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
33
34
35
36
37
38
39
40
41
'use strict';
const path = require('path');
const WriteFileWebpackPlugin = require('./../dist/WriteFileWebpackPlugin.js');
const del = require('del');
const outputPath = path.join(__dirname, './dist');
const publicPath = '/static/';
const devServer = {
contentBase: path.resolve(__dirname, './src'),
quiet: false,
noInfo: false,
publicPath,
historyApiFallback: true,
host: '127.0.0.1',
port: 8000,
hot: false
};
del.sync(path.join(outputPath, '**/*'));
module.exports = {
mode: 'development',
devtool: 'source-map',
devServer: devServer,
context: path.resolve(__dirname, './src'),
entry: {
foo: './app',
bar: './app'
},
output: {
path: outputPath,
filename: '[name].js',
publicPath
},
plugins: [
new WriteFileWebpackPlugin({
test: /foo/
})
]
};