-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
58 lines (51 loc) · 1.27 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
var path = require('path');
var webpack = require('webpack');
var BUILD_DIR = path.resolve(__dirname, 'src/client/public');
var APP_DIR = path.resolve(__dirname, 'src/client/app');
var config = {
devtool: 'source-map',
//entry: path.resolve(APP_DIR, 'components/index.jsx'),
entry: [
'webpack-hot-middleware/client',
APP_DIR + '/components/index.jsx'
// path.resolve(__dirname, '/src/client/public/index.html')
],
output: {
path: BUILD_DIR,
filename: 'bundle.js',
publicPath: '/'
},
devServer: {
contentBase: './src/client/public'
},
plugins: [
// OccurenceOrderPlugin is needed for webpack 1.x only
new webpack.optimize.OccurrenceOrderPlugin(),
new webpack.HotModuleReplacementPlugin(),
new webpack.NoEmitOnErrorsPlugin(),
new webpack.EnvironmentPlugin(['GOOGLE_MAPS_KEY'])
],
module: {
loaders: [
{
test: /\.jsx?/,
include: APP_DIR,
exclude: /node_modules/,
query: {
presets: ['react', 'es2015']
},
loader: 'babel-loader'
},
{
test: /\.css$/,
include: BUILD_DIR,
loader: 'style-loader!css-loader'
},
{
test: /\.json$/,
loader: 'json-loader'
}
]
}
};
module.exports = config;