Add dev runtime from web-starter
This commit is contained in:
35
webpack.config.js
Normal file
35
webpack.config.js
Normal file
@ -0,0 +1,35 @@
|
||||
const path = require('path')
|
||||
const webpack = require('webpack')
|
||||
const autoprefixer = require('autoprefixer')
|
||||
const ExtractTextPlugin = require('extract-text-webpack-plugin')
|
||||
|
||||
const AssetURLPrefix = '[hash:8]/'
|
||||
|
||||
module.exports = {
|
||||
entry: {
|
||||
home: path.resolve(__dirname, 'modules/client/home.js')
|
||||
},
|
||||
|
||||
output: {
|
||||
filename: `${AssetURLPrefix}[name].js`,
|
||||
path: path.resolve(__dirname, 'public/__assets__'),
|
||||
publicPath: '/__assets__/'
|
||||
},
|
||||
|
||||
module: {
|
||||
loaders: [
|
||||
{ test: /\.js$/, exclude: /node_modules/, loader: 'babel' },
|
||||
{ test: /\.css$/, loader: ExtractTextPlugin.extract('style', 'css!postcss') }
|
||||
]
|
||||
},
|
||||
|
||||
plugins: [
|
||||
new webpack.optimize.OccurrenceOrderPlugin(),
|
||||
new ExtractTextPlugin(`${AssetURLPrefix}styles.css`),
|
||||
new webpack.DefinePlugin({
|
||||
'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV || 'development')
|
||||
})
|
||||
],
|
||||
|
||||
postcss: () => [ autoprefixer ]
|
||||
}
|
Reference in New Issue
Block a user