2016-10-11 07:45:00 +00:00
|
|
|
var baseConfig = require('./webpackBaseConfig');
|
|
|
|
var webpack = require('webpack');
|
|
|
|
var ExtractTextPlugin = require("extract-text-webpack-plugin");
|
2016-10-12 09:15:59 +00:00
|
|
|
var path = require('path');
|
|
|
|
var HtmlWebpackPlugin = require('html-webpack-plugin');
|
2016-10-11 07:45:00 +00:00
|
|
|
|
|
|
|
module.exports = Object.assign({}, baseConfig, {
|
|
|
|
plugins: [
|
|
|
|
new webpack.ProvidePlugin({
|
|
|
|
Visibility: "visibilityjs",
|
|
|
|
Cookies: "js-cookie",
|
|
|
|
emojify: "emojify.js",
|
2016-10-14 01:21:25 +00:00
|
|
|
key: "keymaster",
|
|
|
|
$: "jquery",
|
|
|
|
jQuery: "jquery",
|
|
|
|
"window.jQuery": "jquery",
|
|
|
|
"moment": "moment",
|
|
|
|
"Handlebars": "handlebars"
|
2016-10-11 07:45:00 +00:00
|
|
|
}),
|
|
|
|
new ExtractTextPlugin("[name].css"),
|
|
|
|
new webpack.optimize.CommonsChunkPlugin({
|
2016-10-13 00:56:56 +00:00
|
|
|
names: ["vendor", "public", "slide", "locale"],
|
|
|
|
children: true,
|
2016-10-11 09:15:06 +00:00
|
|
|
async: true,
|
|
|
|
filename: '[name].js',
|
|
|
|
minChunks: Infinity
|
2016-10-11 10:59:05 +00:00
|
|
|
}),
|
2016-10-12 09:15:59 +00:00
|
|
|
new HtmlWebpackPlugin({
|
|
|
|
template: 'public/views/includes/header.ejs',
|
|
|
|
chunks: ['vendor', 'index'],
|
|
|
|
filename: path.join(__dirname, 'public/views/build/index-header.ejs'),
|
|
|
|
inject: false
|
|
|
|
}),
|
|
|
|
new HtmlWebpackPlugin({
|
|
|
|
template: 'public/views/includes/scripts.ejs',
|
|
|
|
chunks: ['vendor', 'index'],
|
|
|
|
filename: path.join(__dirname, 'public/views/build/index-scripts.ejs'),
|
|
|
|
inject: false
|
|
|
|
}),
|
|
|
|
new HtmlWebpackPlugin({
|
|
|
|
template: 'public/views/includes/header.ejs',
|
|
|
|
chunks: ['vendor', 'locale'],
|
|
|
|
filename: path.join(__dirname, 'public/views/build/cover-header.ejs'),
|
|
|
|
inject: false
|
|
|
|
}),
|
|
|
|
new HtmlWebpackPlugin({
|
|
|
|
template: 'public/views/includes/scripts.ejs',
|
|
|
|
chunks: ['vendor', 'locale'],
|
|
|
|
filename: path.join(__dirname, 'public/views/build/cover-scripts.ejs'),
|
|
|
|
inject: false
|
|
|
|
}),
|
|
|
|
new HtmlWebpackPlugin({
|
|
|
|
template: 'public/views/includes/header.ejs',
|
|
|
|
chunks: ['vendor', 'public'],
|
|
|
|
filename: path.join(__dirname, 'public/views/build/pretty-header.ejs'),
|
|
|
|
inject: false
|
|
|
|
}),
|
|
|
|
new HtmlWebpackPlugin({
|
|
|
|
template: 'public/views/includes/scripts.ejs',
|
|
|
|
chunks: ['vendor', 'public'],
|
|
|
|
filename: path.join(__dirname, 'public/views/build/pretty-scripts.ejs'),
|
|
|
|
inject: false
|
|
|
|
}),
|
|
|
|
new HtmlWebpackPlugin({
|
|
|
|
template: 'public/views/includes/header.ejs',
|
|
|
|
chunks: ['vendor', 'slide'],
|
|
|
|
filename: path.join(__dirname, 'public/views/build/slide-header.ejs'),
|
|
|
|
inject: false
|
|
|
|
}),
|
|
|
|
new HtmlWebpackPlugin({
|
|
|
|
template: 'public/views/includes/scripts.ejs',
|
|
|
|
chunks: ['vendor', 'slide'],
|
|
|
|
filename: path.join(__dirname, 'public/views/build/slide-scripts.ejs'),
|
|
|
|
inject: false
|
|
|
|
}),
|
2016-10-11 07:45:00 +00:00
|
|
|
new webpack.DefinePlugin({
|
|
|
|
'process.env': {
|
|
|
|
'NODE_ENV': JSON.stringify('production')
|
|
|
|
}
|
|
|
|
}),
|
|
|
|
new webpack.optimize.UglifyJsPlugin({
|
|
|
|
compress: {
|
|
|
|
warnings: false
|
|
|
|
},
|
2016-10-13 00:56:56 +00:00
|
|
|
mangle: false,
|
2016-10-11 07:45:00 +00:00
|
|
|
sourceMap: false
|
|
|
|
})
|
2016-10-12 09:15:59 +00:00
|
|
|
],
|
|
|
|
|
|
|
|
output: {
|
|
|
|
path: path.join(__dirname, 'public/build'),
|
|
|
|
publicPath: '/build/',
|
|
|
|
filename: '[id].[name].[hash].js'
|
|
|
|
},
|
2016-10-11 07:45:00 +00:00
|
|
|
});
|