Allow custom ignore for webpack plugin users
See original GitHub issuePreflight Checklist
- I have read the contribution documentation for this project.
- I agree to follow the code of conduct that this project follows, as appropriate.
- I have searched the issue tracker for a bug that matches the one I want to file, without success.
Issue Details
- Electron Forge Version:
6.0.0-beta.47
- Electron Version:
v7.1.10
- Operating System:
- Last Known Working Electron Forge version::
Expected Behavior
webpack plugin should respect the externals property of the webpack config
Actual Behavior
It doesn’t
To Reproduce
I’m using selenium-webdriver in my app (no, not for testing…), which doesn’t compile with webpack (see https://github.com/SeleniumHQ/selenium/pull/7726 ). I’ve added it to webpack’s externals, which work fine during development:
module.exports = {
// Put your normal webpack config below here
resolve: {
// Add `.ts` and `.tsx` as a resolvable extension.
extensions: ['.ts', '.tsx', '.js'],
},
module: {
rules,
},
externals: [
function(context, request, callback) {
if (
[
'selenium-webdriver',
'selenium-webdriver/chrome',
].includes(request)
) {
return callback(null, 'commonjs ' + request)
}
callback()
},
],
}
Unfortunately, when I package it, all the node_modules are removed, and the app doesn’t start…
The webpack plugin should either understand the externals configuration, or it should include an option to manually whitelist particular dependencies.
Additional Information
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:8 (3 by maintainers)
Top Results From Across the Web
Allow custom ignore for webpack plugin users #1444 - GitHub
I've starting trying to work around my issue by moving all of the dependencies, except the one I want bundled, into devDependencies and ......
Read more >IgnorePlugin - webpack
IgnorePlugin. IgnorePlugin prevents the generation of modules for import or require calls matching the regular expressions or filter functions: ...
Read more >Configuration - webpack
dev is an online tool for creating custom webpack configurations. It allows you to select various features that will be combined and added...
Read more >TerserWebpackPlugin | webpack
Allows you to override default minify function. By default plugin uses terser package. Useful for using and testing unpublished versions or forks. Warning....
Read more >HtmlWebpackPlugin | webpack
The HtmlWebpackPlugin simplifies creation of HTML files to serve your webpack bundles. This is especially useful for webpack bundles that include a hash...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@tsvetilian-ty https://github.com/electron-userland/electron-forge/issues/1451#issuecomment-606039498
Fixed in #2424