Static GitHub Issues

[2559] About [Add webpack plugins]. How to add some special attributes to my js files ?

prev: Nuxt deployment, resulting in page 404, how to achieve the correct static deployment?
next: Nested node_modules are ignored.

Just like this, I use script-ext-html-webpack-plugin to add crossorigin=anonymous.

const ScriptExtHtmlWebpackPlugin = require('script-ext-html-webpack-plugin')

module.exports = {
    build: [
     plugins: [
          // Add webpack plugins,
          // https://github.com/numical/script-ext-html-webpack-plugin
          new ScriptExtHtmlWebpackPlugin({
            defaultAttribute: 'defer',
            custom: [
              {
                test: /\.js$/,
                attribute: 'crossorigin',
                value: 'anonymous'
              }
            ]
          }),
        ],
    ],
}

But it doesn't work.

<!--cmty--><!--cmty_prevent_hook--><div align="right"><sub><em>This question is available on <a href="https://nuxtjs.cmty.io">Nuxt.js</a> community (<a href="https://nuxtjs.cmty.io/nuxt/nuxt.js/issues/c2225">#c2225</a>)</em></sub></div>