@tuia/html-webpack-script-attributes-plugin

给script标签添加attributes

Usage no npm install needed!

<script type="module">
  import tuiaHtmlWebpackScriptAttributesPlugin from 'https://cdn.skypack.dev/@tuia/html-webpack-script-attributes-plugin';
</script>

README

基于html-webpack-plugin的一个插件

可以给script标签添加attributes

Usage

const HtmlWebpackPlugin = require('html-webpack-plugin')
const HtmlWebpackScriptAttributesPlugin = require('html-webpack-script-attributes-plugin');

module.exports = {
  plugins: [
    new HtmlWebpackPlugin(),
    new HtmlWebpackScriptAttributesPlugin({
      crossorigin: 'anonymous'
    })
  ]
}