script-ext-html-webpack-plugin的使用
在webpack.config.js中使用
const ScriptExtHtmlWebpackPlugin = require('script-ext-html-webpack-plugin');
new ScriptExtHtmlWebpackPlugin({
custom: {
test: /\.js$/,
attribute: 'crossorigin',
value: 'anonymous',
},
}),
output: {
path: paths.appBuild,
crossOriginLoading: 'anonymous',
},