-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathwebpack.config.js
42 lines (36 loc) · 967 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
42
const webpack = require('webpack')
const HtmlWebpackPlugin = require('html-webpack-plugin')
const ExtractTextPlugin = require('extract-text-webpack-plugin')
const cssModules = 'modules&importLoaders=1&localIdentName=[name]__[local]__[hash:base64:5]'
module.exports = {
resolve: {
extensions: ['', '.js', '.jsx']
},
entry: ['./src/index.jsx'],
output: {
filename: 'app.js',
path: './build',
publicPath: '/'
},
module: {
loaders: [
{ test: /\.json$/, loader: "json-loader" },
{ test: /\.(js|jsx)$/, exclude: /node_modules/, loaders: ['babel'] },
{ test: /\.css$/, loader: `style-loader!css-loader?${cssModules}` }
]
},
devServer: {
host: '0.0.0.0',
port: 8080,
inline: true
},
plugins: [
new HtmlWebpackPlugin({ template: './src/assets/index.html' }),
new ExtractTextPlugin('style.css', { allChunks: true })
],
node: {
fs: "empty",
net: "empty",
tls: "empty"
}
}