forked from gajus/react-css-modules-examples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
66 lines (63 loc) · 1.51 KB
/
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
var webpack,
path,
WriteFilePlugin,
devServer;
webpack = require('webpack');
path = require('path');
ExtractTextPlugin = require('extract-text-webpack-plugin');
devServer = {
contentBase: path.resolve(__dirname, './endpoint'),
colors: true,
quiet: false,
noInfo: false,
publicPath: '/static/',
historyApiFallback: false,
host: '127.0.0.1',
lazy: true,
port: 8000,
hot: false
};
module.exports = {
devtool: 'eval-source-map',
debug: true,
devServer: devServer,
context: path.resolve(__dirname, './src'),
entry: {
app: [
'webpack-dev-server/client?http://' + devServer.host + ':' + devServer.port,
'./'
]
},
output: {
path: path.resolve(__dirname, './endpoint/static'),
filename: '[name].js',
publicPath: devServer.publicPath
},
plugins: [
new ExtractTextPlugin('app.css', {
allChunks: true
}),
new webpack.NoErrorsPlugin()
],
module: {
loaders: [
{
test: /\.css$/,
loader: ExtractTextPlugin.extract('style', 'css?modules&importLoaders=1&localIdentName=[name]__[local]___[hash:base64:5]')
},
{
test: /\.js$/,
include: path.resolve(__dirname, './src'),
loaders: [
'babel'
]
}
]
},
resolve: {
extensions: [
'',
'.js'
]
}
};