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

commonjs tree shaking not work in webpack5 #14054

Open
ishowman opened this issue Aug 24, 2021 · 6 comments
Open

commonjs tree shaking not work in webpack5 #14054

ishowman opened this issue Aug 24, 2021 · 6 comments

Comments

@ishowman
Copy link

Bug report

What is the current behavior?
all the methods defined in commonjs module will be include in dist file

If the current behavior is a bug, please provide the steps to reproduce.

This is the repo for reproduce。

What is the expected behavior?
only include used methods in my commonjs module

Other relevant information:
webpack version:

  • "webpack": "^5.51.1",
  • "webpack-cli": "^4.8.0"
    Node.js version: v12.14.0
    Operating System: Win 10
    Additional tools: null
@alexander-akait
Copy link
Member

Not implemented yet https://github.com/webpack/webpack/projects/5#card-30291446, but we strongly recommend migrate on ECMA modules

@ishowman
Copy link
Author

Not implemented yet https://github.com/webpack/webpack/projects/5#card-30291446, but we strongly recommend migrate on ECMA modules

I know ECMA modules is the future. But there're still lots of npm packages are commonjs modules, which increase the size of my project.

@webpack-bot
Copy link
Contributor

This issue had no activity for at least three months.

It's subject to automatic issue closing if there is no activity in the next 15 days.

@alexander-akait
Copy link
Member

bump

@webpack-bot
Copy link
Contributor

Issue was closed because of inactivity.

If you think this is still a valid issue, please file a new issue with additional information.

@alexander-akait
Copy link
Member

Still make sense

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants