-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #222 from IronGeek/issue-221
Fix issue with percent encoded filenames
- Loading branch information
Showing
5 changed files
with
58 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
console.log("ok"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"name": "issue-221", | ||
"description": "Test case for https://github.com/waysact/webpack-subresource-integrity/issues/221", | ||
"version": "1.0.0", | ||
"license": "MIT", | ||
"private": true, | ||
"devDependencies": { | ||
"expect": "^26.6.2", | ||
"html-webpack-plugin": ">= 5.0.0-beta.1", | ||
"nyc": "*", | ||
"webpack": "^5.44.0", | ||
"webpack-cli": "4", | ||
"webpack-subresource-integrity": "*" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
const { SubresourceIntegrityPlugin } = require("webpack-subresource-integrity"); | ||
const HtmlWebpackPlugin = require("html-webpack-plugin"); | ||
const expect = require("expect"); | ||
|
||
module.exports = { | ||
entry: { | ||
"why 1+1=2?": "./index.js", | ||
}, | ||
output: { | ||
crossOriginLoading: "anonymous", | ||
}, | ||
plugins: [ | ||
new SubresourceIntegrityPlugin({ | ||
hashFuncNames: ["sha256"], | ||
enabled: true, | ||
}), | ||
new HtmlWebpackPlugin(), | ||
{ | ||
apply: (compiler) => { | ||
compiler.hooks.done.tap("wsi-test", (stats) => { | ||
expect( | ||
stats.toJson().assets.find((asset) => asset.name == "why 1+1=2?.js") | ||
).toHaveProperty("integrity"); | ||
}); | ||
}, | ||
}, | ||
], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters