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

SWC packaging doubles the size of the file #4

Closed
libondev opened this issue Nov 29, 2021 · 4 comments
Closed

SWC packaging doubles the size of the file #4

libondev opened this issue Nov 29, 2021 · 4 comments

Comments

@libondev
Copy link

libondev commented Nov 29, 2021

My package size was 5.43kb before using rollup-plugin-swc3 and using swc replacement rollup-plugin-typescript2 / @rollup / plugin-babel / rollup-plugin-terser plugin grew to 10.79kb is there a question of variable repeat references?


@SukkaW
Copy link
Owner

SukkaW commented Dec 1, 2021

@banlify Any demo or minimum reproduction?

@libondev
Copy link
Author

libondev commented Dec 1, 2021

@banlify Any demo or minimum reproduction?

https://github.com/banlify/swc-build-test

npm run build and npm run build:swc.

You can also view the packaged files under dist/

@SukkaW
Copy link
Owner

SukkaW commented Dec 1, 2021

@banlify Any demo or minimum reproduction?

https://github.com/banlify/swc-build-test

npm run build and npm run build:swc.

You can also view the packaged files under dist/

@monitor/utils seems to be an external dependency, which will not be processed by the plugin by default.

Use option exclude: null (or exclude: /node_modules/core-js) to let swc process your external dependency.

@SukkaW SukkaW closed this as completed Dec 1, 2021
@libondev
Copy link
Author

libondev commented Dec 1, 2021

@banlify Any demo or minimum reproduction?

https://github.com/banlify/swc-build-test
npm run build and npm run build:swc.
You can also view the packaged files under dist/

@monitor/utils seems to be an external dependency, which will not be processed by the plugin by default.

Use option exclude: null (or exclude: /node_modules/core-js) to let swc process your external dependency.

No, it is not an external dependency, it is a file in my Packages /utils folder, I am using PNPM's Monorepo mode

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