HTML Webpack Plugin Cross Origin (Webpack 4)
This plugin adapt html-webpack-inject-attributes-plugin(v1.0.0) for webpack 4.
npm i --save-dev html-webpack-plugin-crossorigin
Usage
const HtmlWebpackPlugin = ;const HtmlWebpackPluginCrossorigin = ; plugins: filename: 'test.html' template: 'src/assets/test.html' // add script attributes here! attributes: crossorigin: 'anonymous' // this one should be placed after HtmlWebpackPlugin inject: true ;
It will add the crossorigin=anonymous
to script tag like:
This plugin fixed the problem from the origin one:
ERROR in TypeError: callback is not a function
- index.js:35 [ex-child-webpack]/[html-webpack-inject-attributes-plugin]/index.js:35:13