question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Allow custom ignore for webpack plugin users

See original GitHub issue

Preflight 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::

image

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:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found