Skip to content

Commit 23e0d2c

Browse files
authored
Merge pull request #118 from icelam/fix/v1/default-target
fix: chage the default test scope to avoid targeting map files or gzip files
2 parents 9b386b1 + cecd2de commit 23e0d2c

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ module.exports = {
4343
plugins: [
4444
new HtmlWebpackPlugin(),
4545
new HtmlInlineScriptPlugin([
46-
/runtime~.+[.]js/,
47-
/app~.+[.]js/
46+
/runtime~.+[.]js$/,
47+
/app~.+[.]js$/
4848
]),
4949
]
5050
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@
3636
"@commitlint/config-conventional": "^12.0.0",
3737
"@types/html-webpack-plugin": "^3.2.3",
3838
"@types/jest": "^26.0.20",
39-
"@types/webpack": "^4.41.26",
4039
"@types/webpack-sources": "^2.1.0",
4140
"@typescript-eslint/eslint-plugin": "^4.0.0",
4241
"@typescript-eslint/parser": "^4.15.2",
@@ -54,6 +53,7 @@
5453
"typescript": "^4.1.3"
5554
},
5655
"peerDependencies": {
56+
"@types/webpack": "^4.41.28",
5757
"html-webpack-plugin": "^4.0.0",
5858
"webpack": "^4.0.0"
5959
}

src/HtmlInlineScriptPlugin.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ class HtmlInlineScriptPlugin implements Plugin {
88
tests: RegExp[];
99

1010
constructor(tests?: RegExp[]) {
11-
this.tests = tests || [/.+[.]js/];
11+
this.tests = tests || [/.+[.]js$/];
1212
}
1313

1414
isFileNeedsToBeInlined(

yarn.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -850,7 +850,7 @@
850850
"@types/source-list-map" "*"
851851
source-map "^0.7.3"
852852

853-
"@types/webpack@^4", "@types/webpack@^4.41.26":
853+
"@types/webpack@^4":
854854
version "4.41.27"
855855
resolved "https://registry.yarnpkg.com/@types/webpack/-/webpack-4.41.27.tgz#f47da488c8037e7f1b2dbf2714fbbacb61ec0ffc"
856856
integrity sha512-wK/oi5gcHi72VMTbOaQ70VcDxSQ1uX8S2tukBK9ARuGXrYM/+u4ou73roc7trXDNmCxCoerE8zruQqX/wuHszA==

0 commit comments

Comments
 (0)