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

forceExclude should apply to peerDependencies #984

Open
danobri opened this issue Oct 26, 2021 · 2 comments
Open

forceExclude should apply to peerDependencies #984

danobri opened this issue Oct 26, 2021 · 2 comments

Comments

@danobri
Copy link

danobri commented Oct 26, 2021

This is a (Feature Proposal)

Description

  • What is the use case that should be solved?
    The forceExclude option currently only applies to devDependencies, but peerDependencies is a more appropriate place for aws-sdk. Putting it in devDependencies is a violation of the following lint rule:
    https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-extraneous-dependencies.md
    Can serverless-webpack be updated so that forceExclude also applies to peerDependencies?

  • If there is additional config how would it look
    No additional config required

Related issue(s):

Additional Data

  • Serverless-Webpack Version you're using:5.5.5
  • Webpack version you're using:5.60.0
  • Serverless Framework Version you're using:2.64.1
  • Operating System:Mac BigSur 11.6
  • Stack Trace (if available): N/A
@vicary
Copy link
Member

vicary commented Nov 1, 2021

This is a breaking change, so we'd better have good reasons for that. PRs are welcomed.

Otherwise you may switch to a custom webpack.config.js to gain more control on which sections in package.json to exclude with webpack-node-externals, see the modulesFromFile#excludeFromBundle option.

@NPellet
Copy link

NPellet commented Nov 17, 2022

Well, I would think forceExclude is the equivalent to "trust me bro, I know what I'm doing".
Would allow me to nicely get rid of typescript and all the other stuff I don't want bundled and provide a nice escape hatch to all the issues brought by peerDependencies being bundled in

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

3 participants