-
Notifications
You must be signed in to change notification settings - Fork 1
/
webpack.config.babel.js
44 lines (40 loc) · 1.04 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
43
44
import webpack from 'webpack'
import path from 'path'
import config from 'config'
console.log(config)
const plugins = [
new webpack.DefinePlugin({
'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV),
APP_CONFIG: JSON.stringify(config),
}),
]
/*
if (process.env.NODE_ENV === 'production') {
plugins.push(
new webpack.optimize.UglifyJsPlugin({ compress: { drop_debugger: true, drop_console: true } }),
)
}
*/
module.exports = {
entry: './src/application.jsx',
output: {
path: path.resolve(__dirname, 'docs'),
filename: 'application.js',
},
plugins,
resolve: {
modules: [path.resolve(__dirname, 'src'), 'node_modules'],
extensions: ['.js', '.jsx', '.json'],
},
module: {
loaders: [
{ test: /\.jsx?$/, exclude: /node_modules/, loaders: ['babel-loader'] },
{ test: /application\.s[ac]ss$/, loaders: ['style-loader', 'css-loader', 'sass-loader'] },
],
},
devServer: {
contentBase: './docs',
port: config.WEBPACK_DEV_SERVER_PORT || 8090,
historyApiFallback: true,
},
}