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

Document how to add new dependencies #62

Closed
1 of 2 tasks
haakemon opened this issue Jul 7, 2022 · 2 comments
Closed
1 of 2 tasks

Document how to add new dependencies #62

haakemon opened this issue Jul 7, 2022 · 2 comments

Comments

@haakemon
Copy link
Contributor

haakemon commented Jul 7, 2022

Description

If we dont add new dependencies to the exclude list in rollup config, then the dependency will be bundled. This is in most cases not what we want - we want the dependency to be resolved automatically where the package is used.

Related comment #60 (comment)

Additional Information

Could also look into if there exists a rollup plugin to handle this automatically, similar to how peerDependencies are handled

Tasks

No response

Acceptance Criterias

  • Document that when adding a new dependency to package.json, you also have to update exclude list in rollup config
    OR
  • Find a plugin that will deal with this automatically

The end result should be the same - items in dependencies in package.json should not be part of the generated bundle.

@haakemon haakemon added status/draft Status: When you create an issue before you have enough info to properly describe the issue. and removed status/draft Status: When you create an issue before you have enough info to properly describe the issue. labels Jul 7, 2022
@haakemon haakemon mentioned this issue Jul 7, 2022
4 tasks
@olemartinorg
Copy link
Contributor

This is the code I've been using in another project to exclude packages:

import pkg from 'package.json';

const externals = []
    .concat(Object.keys(pkg.dependencies))
    .concat(Object.keys(pkg.devDependencies))
    .concat(require('module').builtinModules || Object.keys(process.binding('natives')));

@haakemon haakemon mentioned this issue Aug 1, 2022
5 tasks
@haakemon
Copy link
Contributor Author

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