nyx_server
Version:
Node内容发布
61 lines (58 loc) • 1.51 kB
JavaScript
var path = require('path');
var webpack = require('webpack');
var HtmlWebpackPlugin = require('html-webpack-plugin');
var ExtractTextPlugin = require('extract-text-webpack-plugin');
var StatsPlugin = require('stats-webpack-plugin');
module.exports = {
entry: [
path.join(__dirname, 'ui/app/main.js')
],
output: {
path: path.join(__dirname, 'ui/dist'),
filename: '[name]-[hash].min.js',
publicPath: '/dist'
},
plugins: [
new webpack.optimize.OccurenceOrderPlugin(),
new HtmlWebpackPlugin({
template: 'ui/app/index.tpl.html',
inject: 'body',
filename: 'index.ejs',
isDev: '<%=isDev%>'
}),
new ExtractTextPlugin('[name]-[hash].min.css', {
publicPath: '/dist'
}),
new webpack.optimize.UglifyJsPlugin({
compressor: {
warnings: false,
screw_ie8: true
}
}),
new StatsPlugin('webpack.stats.json', {
source: false,
modules: false
}),
new webpack.DefinePlugin({
'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV)
})
],
module: {
loaders: [{
test: /\.js?$/,
exclude: /node_modules/,
loader: 'babel'
}, {
test: /\.json?$/,
loader: 'json'
}, {
test: /\.css$/,
// loader: ExtractTextPlugin.extract('style', 'css?modules&localIdentName=[name]---[local]---[hash:base64:5]!postcss')
loader: ExtractTextPlugin.extract('style', 'css')
}]
},
postcss: [
require('autoprefixer')
]
};
;