File tree Expand file tree Collapse file tree 5 files changed +58
-1
lines changed
webpack-subresource-integrity/src Expand file tree Collapse file tree 5 files changed +58
-1
lines changed Original file line number Diff line number Diff line change 1+ console . log ( "ok" ) ;
Original file line number Diff line number Diff line change 1+ {
2+ "name" : " issue-221" ,
3+ "description" : " Test case for https://github.com/waysact/webpack-subresource-integrity/issues/221" ,
4+ "version" : " 1.0.0" ,
5+ "license" : " MIT" ,
6+ "private" : true ,
7+ "devDependencies" : {
8+ "expect" : " ^26.6.2" ,
9+ "html-webpack-plugin" : " >= 5.0.0-beta.1" ,
10+ "nyc" : " *" ,
11+ "webpack" : " ^5.44.0" ,
12+ "webpack-cli" : " 4" ,
13+ "webpack-subresource-integrity" : " *"
14+ }
15+ }
Original file line number Diff line number Diff line change 1+ const { SubresourceIntegrityPlugin } = require ( "webpack-subresource-integrity" ) ;
2+ const HtmlWebpackPlugin = require ( "html-webpack-plugin" ) ;
3+ const expect = require ( "expect" ) ;
4+
5+ module . exports = {
6+ entry : {
7+ "why 1+1=2?" : "./index.js" ,
8+ } ,
9+ output : {
10+ crossOriginLoading : "anonymous" ,
11+ } ,
12+ plugins : [
13+ new SubresourceIntegrityPlugin ( {
14+ hashFuncNames : [ "sha256" ] ,
15+ enabled : true ,
16+ } ) ,
17+ new HtmlWebpackPlugin ( ) ,
18+ {
19+ apply : ( compiler ) => {
20+ compiler . hooks . done . tap ( "wsi-test" , ( stats ) => {
21+ expect (
22+ stats . toJson ( ) . assets . find ( ( asset ) => asset . name == "why 1+1=2?.js" )
23+ ) . toHaveProperty ( "integrity" ) ;
24+ } ) ;
25+ } ,
26+ } ,
27+ ] ,
28+ } ;
Original file line number Diff line number Diff line change @@ -238,7 +238,7 @@ export class Plugin {
238238 */
239239 private hwpAssetPath = ( src : string ) : string => {
240240 assert ( this . hwpPublicPath !== null , "Missing HtmlWebpackPlugin publicPath" ) ;
241- return relative ( this . hwpPublicPath , src ) ;
241+ return relative ( this . hwpPublicPath , decodeURIComponent ( src ) ) ;
242242 } ;
243243
244244 /**
Original file line number Diff line number Diff line change @@ -5518,6 +5518,19 @@ __metadata:
55185518 languageName : unknown
55195519 linkType : soft
55205520
5521+ " issue-221@workspace:examples/issue-221 " :
5522+ version : 0.0.0-use.local
5523+ resolution : " issue-221@workspace:examples/issue-221"
5524+ dependencies :
5525+ expect : ^26.6.2
5526+ html-webpack-plugin : " >= 5.0.0-beta.1"
5527+ nyc : " *"
5528+ webpack : ^5.44.0
5529+ webpack-cli : 4
5530+ webpack-subresource-integrity : " *"
5531+ languageName : unknown
5532+ linkType : soft
5533+
55215534" istanbul-lib-coverage@npm:^3.0.0, istanbul-lib-coverage@npm:^3.2.0 " :
55225535 version : 3.2.0
55235536 resolution : " istanbul-lib-coverage@npm:3.2.0"
You can’t perform that action at this time.
0 commit comments