Replies: 1 comment 5 replies
-
That would not be trivial. After all, you cannot know what imports there will be until you parsed EVERYTHING. And what if the module then again imports itself (just a hypothetical idea)? If you mark your import as "external", you might use a prebuilt chunk, but that might not be what you want https://rollupjs.org/plugin-development/#this-emitfile |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm trying to make a compiler for a WebAssembly-based language, and I'd like to add treeshaking if possible (before the compilation process into WebAssembly). The problem is, I can't figure out any way to identify the named imports that other files are attempting to import, so that I can forward those on to the compiler and generate the wasm output and JS glue code.
Short version, is there any way to get incoming imports to a virtual module before generating the virtual module code (so, if I understand correctly, before
load()
)?Relevant issue (I think): #2482
Beta Was this translation helpful? Give feedback.
All reactions