Revert wepack changes

This commit is contained in:
Surma
2019-02-25 10:53:16 +00:00
parent 7dd842a870
commit 915f4cd4e6

View File

@@ -38,21 +38,12 @@ module.exports = async function (_, env) {
return { return {
mode: isProd ? 'production' : 'development', mode: isProd ? 'production' : 'development',
entry: { entry: {
'first-interaction': './src/index', 'first-interaction': './src/index'
'sdk': './src/sdk'
}, },
devtool: isProd ? 'source-map' : 'inline-source-map', devtool: isProd ? 'source-map' : 'inline-source-map',
stats: 'minimal', stats: 'minimal',
output: { output: {
filename: chunkData => { filename: isProd ? '[name].[chunkhash:5].js' : '[name].js',
if(chunkData.chunk.name === 'sdk') {
return 'sdk.js';
}
if(!isProd) {
return '[name].js';
}
return '[name].[chunkhash:5].js'
},
chunkFilename: '[name].[chunkhash:5].js', chunkFilename: '[name].[chunkhash:5].js',
path: path.join(__dirname, 'build'), path: path.join(__dirname, 'build'),
publicPath: '/', publicPath: '/',
@@ -240,7 +231,7 @@ module.exports = async function (_, env) {
// For now we're not doing SSR. // For now we're not doing SSR.
new HtmlPlugin({ new HtmlPlugin({
filename: path.join(__dirname, 'build/index.html'), filename: path.join(__dirname, 'build/index.html'),
template: isProd ? '!!prerender-loader?string&entry=./src/index!src/index.html' : 'src/index.html', template: isProd ? '!!prerender-loader?string!src/index.html' : 'src/index.html',
minify: isProd && { minify: isProd && {
collapseWhitespace: true, collapseWhitespace: true,
removeScriptTypeAttributes: true, removeScriptTypeAttributes: true,