ncc icon indicating copy to clipboard operation
ncc copied to clipboard

Is there any tree-shaking strategy?

Open SandZn opened this issue 1 year ago • 3 comments

Hi, is there any tree-shaking strategy in ncc, like what bundlers do on front-end applications? I wonder how do you deal with the dynamic "require" while compiling. Thank you.

SandZn avatar Mar 19 '23 16:03 SandZn

Meet the same question. Ncc always ignore process.env.NODE_ENV == production, and build all.

criejs avatar Apr 24 '23 05:04 criejs

+1

Tree shaking would be fantastic.

BenJackGill avatar Oct 23 '23 16:10 BenJackGill

I have noticed that if i import from a package like this: import {find as event_find} from "event";

The whole package gets bundled. All the methods that I am not using from the 'event' package are getting bundled too.

gregg-cbs avatar Sep 17 '24 21:09 gregg-cbs