diff --git a/build/webpack.prod.conf.js b/build/webpack.prod.conf.js index e89f5741..d48a8f85 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 OptimizeCSSAssetsPlugin = require('optimize-css-assets-webpack-plugin') const UglifyJsPlugin = require('uglifyjs-webpack-plugin') @@ -63,6 +64,10 @@ const webpackConfig = merge(baseWebpackConfig, { // matter anyway 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 c3611d3f..84cf1c6f 100644 --- a/package.json +++ b/package.json @@ -50,6 +50,7 @@ "normalize.css": "7.0.0", "nprogress": "0.2.0", "screenfull": "3.3.2", + "script-ext-html-webpack-plugin": "2.0.1", "serve-static": "1.13.2", "showdown": "1.8.5", "simplemde": "1.11.2",