nyx_server
Version:
Node内容发布
47 lines (44 loc) • 1.24 kB
JavaScript
var path = require('path');
var webpack = require('webpack');
var HtmlWebpackPlugin = require('html-webpack-plugin');
module.exports = {
devtool: 'eval-source-map',
entry: [
path.join(__dirname, 'node_modules/webpack-hot-middleware/client?reload=true'),
path.join(__dirname, 'ui/app/main.js')
],
output: {
path: path.join(__dirname, 'ui/dist/'),
filename: '[name].js',
publicPath: '/' //path.join(__dirname, '/')
},
plugins: [
new HtmlWebpackPlugin({
template: path.join(__dirname, 'ui/app/index.tpl.html'),
inject: 'body',
filename: 'index.html',
isDev: '<%=isDev%>'
}),
new webpack.optimize.OccurenceOrderPlugin(),
new webpack.HotModuleReplacementPlugin(),
new webpack.NoErrorsPlugin(),
new webpack.DefinePlugin({
'process.env.NODE_ENV': JSON.stringify('development')
})
],
module: {
loaders: [{
test: /\.js?$/,
exclude: /node_modules/,
loader: path.join(__dirname, 'node_modules/babel-loader')
}, {
test: /\.json?$/,
loader: 'json'
}, {
test: /\.css$/,
loader: 'style!css'
// loader: 'style!css?modules&localIdentName=[name]---[local]---[hash:base64:5]'
}]
}
};
;