1.0.8 • Published 6 years ago

html-webpack-plugin-crossorigin v1.0.8

Weekly downloads
6,314
License
MIT
Repository
github
Last release
6 years ago

#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 = require('html-webpack-plugin');
const HtmlWebpackPluginCrossorigin = require('html-webpack-plugin-crossorigin');

new HtmlWebpackPlugin({
    plugins: [
        new HtmlWebpackPlugin({
            filename: 'test.html',
            template: 'src/assets/test.html'
            // add script attributes here!
            attributes: {
                crossorigin: 'anonymous'
            }
        }),
        // this one should be placed after HtmlWebpackPlugin
        new HtmlWebpackPluginCrossorigin({
            inject: true
        })
    ]
});

It will add the crossorigin=anonymous to script tag like:

<script src="index.js" crossorigin="anonymous"></script>

This plugin fixed the problem from the origin one:

ERROR in TypeError: callback is not a function

1.0.8

6 years ago

1.0.7

6 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

3.2.2

6 years ago

1.0.2

6 years ago

3.2.1

6 years ago

1.0.0

6 years ago

3.2.0

6 years ago