-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Note that the test case isn't very useful as an automatic test because behaviour differs between browser models and versions, and the test is only run in a single Chromium version via Puppeteer. The test is still useful when run manually, like so: npm install # install requirements npm install webpack@4 \ extract-text-webpack-plugin@4.0.0-alpha.0 \ html-webpack-plugin@3 # upgrade to Webpack 4 npm run mocha # Run mocha tests (cd examples/webpack-preload/dist/ && python -m SimpleHTTPServer) # Visit http://localhost:8000/ with different browsers See #111
- Loading branch information
Showing
7 changed files
with
52 additions
and
0 deletions.
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,3 @@ | ||
# With `/* webpackPreload: "true" */` | ||
|
||
https://github.com/waysact/webpack-subresource-integrity/issues/111 |
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 @@ | ||
import('./lazy-chunk-1.js'); |
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 @@ | ||
import(/* webpackPreload: true */ './lazy-chunk-2.js'); |
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,8 @@ | ||
var webpackVersion = Number( | ||
require('webpack/package.json').version.split('.')[0] | ||
); | ||
|
||
module.exports.skip = function skip() { | ||
// webpack-preload tag breaks Webpack 1 | ||
return webpackVersion < 2; | ||
}; |
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,18 @@ | ||
var SriPlugin = require('webpack-subresource-integrity'); | ||
var HtmlWebpackPlugin = require('html-webpack-plugin'); | ||
|
||
module.exports = { | ||
entry: { | ||
index: './index.js' | ||
}, | ||
output: { | ||
crossOriginLoading: 'anonymous' | ||
}, | ||
plugins: [ | ||
new SriPlugin({ | ||
hashFuncNames: ['sha256', 'sha384'], | ||
enabled: true | ||
}), | ||
new HtmlWebpackPlugin() | ||
] | ||
}; |
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