Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Analog of webpack-node-externals #3973

Closed
krutoo opened this issue Jan 9, 2020 · 1 comment
Closed

Analog of webpack-node-externals #3973

krutoo opened this issue Jan 9, 2020 · 1 comment

Comments

@krutoo
Copy link

krutoo commented Jan 9, 2020

Hi. How can i declare list of packages for node.js target bundle to force add all items to bundle?

I mean behaviour like externals in webpack: https://webpack.js.org/configuration/externals/

const nodeExternals = require('webpack-node-externals');

module.exports = {
  // ...
  target: 'node',
  externals: nodeExternals({
    whitelist: [/^react-.*/], // all packages starts with "react-" will be added in bundle
  })
  // ...
}
@mischnic
Copy link
Member

mischnic commented Jan 9, 2020

This is not supported in Parcel 1.
With Parcel 2, you can set includeNodeModules in the package.json:

{
  "default": "dist/index.js",
  "targets": {
    "default": {
      "includeNodeModules": ["react", "react-dom"]
    }
  }
}

Related: #3305, #144

@mischnic mischnic closed this as completed Jan 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants