1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-12 17:26:17 +00:00
Files
Boostnote/webpack-production.config.js
2016-01-02 04:17:08 +09:00

47 lines
1.1 KiB
JavaScript

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-loader!css-loader!stylus-loader'
}
]
},
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')
}
}),
new webpack.optimize.UglifyJsPlugin({
compressor: {
warnings: false
}
})
]
})
module.exports = config