Skip to content

fengyima/html-webpack-script-crossorigin-plugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

说明

在HTML的script标签中加入crossorigin="anonymous"

安装

   npm install html-webpack-script-crossorigin-plugin 

使用

    //配置srcOrigin来添加crossorigin="anonymous"
    //srcOrigin为false或未定义的时候,则全局都添加crossorigin="anonymous"
    plugins = [
        new HtmlWebpackScriptCrossoriginPlugin({
            srcOrigin: "s4.fx.kgimg.com" //可以是数组,也可以是string
        })
    ]

注意

如果和会更改HTML中资源src的插件混用,请把该插件放到最后,因为该插件是通过匹配script标签中的src来添加crossorigin="anonymous"的

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published