-
Notifications
You must be signed in to change notification settings - Fork 1
/
webpack.config.examples.js
56 lines (47 loc) · 1023 Bytes
/
webpack.config.examples.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
module.exports = {
context: __dirname,
entry: {
index: './examples/counter/App.js',
// html: './examples/counter/index.html',
},
output: {
publicPath: '',
path: './dist/examples/counter',
filename: '[name].js',
library: 'Counter',
libraryTarget: 'var',
},
debug: true,
devtool: 'source-map',
devServer: {
hot: true,
inline: true,
contentBase: './dist/examples/counter',
keepalive: true,
port: 9000,
host: 'localhost',
stats: 'errors-only',
},
resolve: {
root: __dirname,
modulesDirectories: ['./examples/counter', 'node_modules'],
extensions: ['', '.js', '.html'],
},
resolveLoader: {
root: '.',
},
module: {
exprContextCritical: false, // Removes warning about dynamic require()
loaders: [
{
test: /\.html$/,
loader: 'file?name=[name].[ext]',
},
{
test: /\.js$/,
exclude: /node_modules/,
loaders: ['babel?cacheDirectory'],
},
],
},
};