setup webpack

This commit is contained in:
2017-01-22 10:51:08 -07:00
parent 74453d75fc
commit c85b2e2702
16 changed files with 3154 additions and 72 deletions

View File

@@ -0,0 +1,27 @@
const path = require('path');
const webpack = require('webpack');
const merge = require('webpack-merge');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const baseConfig = require('./webpack.base');
const ROOT = path.resolve(__dirname, '..', '..');
module.exports = merge(baseConfig, {
plugins: [
new webpack.DefinePlugin({
'process.env': {
NODE_ENV: '"development"',
},
}),
// generate dist index.html with correct asset hash for caching.
// you can customize output by editing /index.html
// see https://github.com/ampedandwired/html-webpack-plugin
new HtmlWebpackPlugin({
filename: path.join(ROOT, 'client', 'index.html'),
template: path.join(ROOT, 'src', 'index.html'),
inject: true,
// necessary to consistently work with multiple chunks via CommonsChunkPlugin
chunksSortMode: 'dependency',
}),
],
});