diff --git a/build/webpack.prod.conf.js b/build/webpack.prod.conf.js index adceb7b..873027d 100644 --- a/build/webpack.prod.conf.js +++ b/build/webpack.prod.conf.js @@ -7,6 +7,7 @@ const merge = require('webpack-merge') const baseWebpackConfig = require('./webpack.base.conf') const CopyWebpackPlugin = require('copy-webpack-plugin') const HtmlWebpackPlugin = require('html-webpack-plugin') +const ScriptExtHtmlWebpackPlugin = require('script-ext-html-webpack-plugin') const MiniCssExtractPlugin = require('mini-css-extract-plugin') const OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin') const UglifyJsPlugin = require('uglifyjs-webpack-plugin') @@ -84,6 +85,10 @@ const webpackConfig = merge(baseWebpackConfig, { // necessary to consistently work with multiple chunks chunksSortMode: 'none' }), + new ScriptExtHtmlWebpackPlugin({ + //`runtime` must same as runtimeChunk name. default is `runtime` + inline: /runtime\..*\.js$/ + }), // keep module.id stable when vender modules does not change new webpack.HashedModuleIdsPlugin(), // copy custom static assets diff --git a/package.json b/package.json index 9c155f4..dbe3918 100644 --- a/package.json +++ b/package.json @@ -55,6 +55,7 @@ "postcss-url": "7.3.2", "rimraf": "2.6.2", "sass-loader": "7.0.3", + "script-ext-html-webpack-plugin": "2.0.1", "semver": "5.5.0", "shelljs": "0.8.2", "svg-sprite-loader": "3.8.0",