Skip to content

Commit 1fe4095

Browse files
committed
fix: 锁住webpack-subresouce版本,避免integrity=null的问题
1 parent c2ef842 commit 1fe4095

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "builder-webpack4",
3-
"version": "0.0.14",
3+
"version": "0.0.15",
44
"description": "webpack项目构建器.",
55
"main": "lib/index.js",
66
"scripts": {
@@ -17,7 +17,7 @@
1717
},
1818
"license": "MIT",
1919
"configs": {
20-
"compatibleVersion": ">=0.0.14"
20+
"compatibleVersion": ">=0.0.15"
2121
},
2222
"keywords": [
2323
"webpack",
@@ -65,7 +65,7 @@
6565
"webpack": "^4.20.2",
6666
"webpack-dev-middleware": "^3.4.0",
6767
"webpack-hot-middleware": "^2.22.3",
68-
"webpack-subresource-integrity": "^1.3.1",
68+
"webpack-subresource-integrity": "1.1.0",
6969
"html-webpack-include-assets-plugin": "1.0.7"
7070
},
7171
"devDependencies": {

src/builder.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -707,7 +707,7 @@ class Builder {
707707
// 去掉 业务 js 文件的 ?_bid=152
708708
source = source.replace(/\?_bid=152/g, '');
709709
// 去掉业务 js 上的 integrity 属性
710-
source = source.replace(/(<script.*)integrity=".*?"/, '$1');
710+
source = source.replace(/(<script.*)integrity=".*?"/g, '$1');
711711
// 注入离线包的版本号. pack
712712
const inject = {
713713
version: Date.now()

0 commit comments

Comments
 (0)