Skip to content

Commit 208cd4b

Browse files
committed
feat: 设置可以禁用SRI
1 parent cb5560c commit 208cd4b

2 files changed

Lines changed: 6 additions & 4 deletions

File tree

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "builder-webpack4",
3-
"version": "0.0.13",
3+
"version": "0.0.14",
44
"description": "webpack项目构建器.",
55
"main": "lib/index.js",
66
"scripts": {
@@ -17,7 +17,7 @@
1717
},
1818
"license": "MIT",
1919
"configs": {
20-
"compatibleVersion": ">=0.0.13"
20+
"compatibleVersion": ">=0.0.14"
2121
},
2222
"keywords": [
2323
"webpack",

src/builder.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -281,8 +281,10 @@ class Builder {
281281
prodPlugins.push(new HTMLInlineCSSWebpackPlugin());
282282
}
283283

284-
// 给生成出来的js bundle增加跨域头(cross-origin),便于错误日志记录
285-
prodPlugins.push(this.setSriPlugin());
284+
if (options.useSri !== false) {
285+
// 给生成出来的js bundle增加跨域头(cross-origin),便于错误日志记录
286+
prodPlugins.push(this.setSriPlugin());
287+
}
286288

287289
prodPlugins.push(this.setOffline(assetsPrefix, htmlPrefix, cdnUrl, serverUrl, domain, cdn, product, options.outDir));
288290

0 commit comments

Comments
 (0)