forked from BoostIO/BoostNote-Legacy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack-production.config.js
45 lines (43 loc) · 1.16 KB
/
webpack-production.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
const skeleton = require('./webpack-skeleton')
const webpack = require('webpack')
const path = require('path')
const NodeTargetPlugin = require('webpack/lib/node/NodeTargetPlugin')
var config = Object.assign({}, skeleton, {
module: {
loaders: [
{
test: /(\.js|\.jsx)?$/,
exclude: /(node_modules|bower_components)/,
loader: 'babel'
},
{
test: /\.styl$/,
exclude: /(node_modules|bower_components)/,
loader: 'style!css?modules&importLoaders=1&localIdentName=[name]__[local]___[path]!stylus?sourceMap'
},
{
test: /\.json$/,
loader: 'json'
}
]
},
output: {
path: path.join(__dirname, 'compiled'),
filename: '[name].js',
libraryTarget: 'commonjs2',
sourceMapFilename: '[name].map',
publicPath: 'http://localhost:8080/assets/'
},
plugins: [
new webpack.NoErrorsPlugin(),
new NodeTargetPlugin(),
new webpack.optimize.OccurenceOrderPlugin(),
new webpack.DefinePlugin({
'process.env': {
'NODE_ENV': JSON.stringify('production'),
'BABEL_ENV': JSON.stringify('production')
}
})
]
})
module.exports = config