Closed cyqresig closed 6 years ago
I solved the issue by moving script-ext-html-webpack-plugin under html-webpack-plugin in plugins
@MQuy Thank u for the answer. Now it works.
I get exactly the same error when used along with speed-measure-webpack-plugin, even if the order of plugins is the one mentioned above...
Works just fine if I disable the speed-measure-webpack-plugin. Should I raise a separate issue?
@grzegorzjudas I have the same question, have you solve it?
Not really, I've used --env.perfcheck
flag in order to conditionally enable speed-measure-webpack-plugin and disable script-ext-html-webpack-plugin
.
The resulting build of course doesn't work because the script tag doesn't have "defer" in it, but I can still reliably check the build time.
@MQuy Thank u for the answer. Now it works.
new HtmlWebpackPlugin({
template: path.resolve(__dirname, './public/index.html')
}),
new ScriptExtHtmlWebpackPlugin({
inline: /runtime\..*\.js$/
})
问题依然存在
TypeError: Cannot read property 'tap' of undefined at ScriptExtHtmlWebpackPlugin.compilationCallback (/Users/user/temp/peon-react-redux-test/node_modules/script-ext-html-webpack-plugin/lib/plugin.js:50:56)
while executing the code next line
compilation.hooks.htmlWebpackPluginAlterAssetTags.tap(PLUGIN, alterAssetTags);
'compilation.hooks.htmlWebpackPluginAlterAssetTags' is undefined. but html-webpack-plugin works well. I'm so confused about it.script-ext-html-webpack-plugin 2.0.1 html-webpack-plugin 3.2.0 webpack 4.7.0