-
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.
Don't warn for electron-renderer target
Also try to detect all other web-like targets with Webpack 5. Closes #134
- Loading branch information
Showing
5 changed files
with
42 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,3 @@ | ||
# Electron Renderer target | ||
|
||
Ensure the plugin doesn't warn for electron-renderer targets. |
Empty file.
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,13 @@ | ||
var expect = require('expect'); | ||
var webpackVersion = Number( | ||
require('webpack/package.json').version.split('.')[0] | ||
); | ||
|
||
module.exports.skip = function skip() { | ||
return webpackVersion < 5; | ||
}; | ||
|
||
module.exports.check = function check(stats) { | ||
expect(stats.compilation.errors).toEqual([]); | ||
expect(stats.compilation.warnings).toEqual([]); | ||
}; |
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,19 @@ | ||
var SriPlugin = require('webpack-subresource-integrity'); | ||
var HtmlWebpackPlugin = require('html-webpack-plugin'); | ||
|
||
module.exports = { | ||
entry: { | ||
index: './index.js' | ||
}, | ||
target: 'electron-renderer', | ||
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