-
Notifications
You must be signed in to change notification settings - Fork 93
/
webpack.config.babel.js
42 lines (39 loc) · 1.19 KB
/
webpack.config.babel.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
import path from 'path';
import webpack from 'webpack';
import ExtractTextPlugin from 'extract-text-webpack-plugin';
var version = require('./package.json').version;
let config = {
entry: {
app: path.resolve('webapp/app.js')
},
output: {
path: path.resolve(`public/assets/${version}`),
filename: '[name].js',
publicPath: `http://localhost:8080/${version}/`
},
module: {
preLoaders: [
{test: /\.js(x)?$/, loader: 'eslint-loader', exclude: /node_modules/}
],
loaders: [
{test: /\.js(x)?$/, loaders: ['react-hot', 'babel'], exclude: /node_modules/},
{test: /\.json$/, loaders: ['json']},
{test: /\.css$/, loader: ExtractTextPlugin.extract('style-loader', 'css-loader')},
]
},
plugins: [
new webpack.NoErrorsPlugin(),
new webpack.EnvironmentPlugin(Object.keys(process.env)),
new ExtractTextPlugin('[name].css'),
// Implementing fix https://github.com/callemall/material-ui/issues/2336 by https://github.com/chadrien
new webpack.DefinePlugin({
process: {
env: {
NODE_ENV: JSON.stringify(process.env.NODE_ENV)
}
}
}),
],
devtool: 'source-map'
};
export default config;