Replies: 1 comment
-
I am facing the same issue. Our build tool chain does work in data instead of files. Using the virtual plugin actually works as long as the data is plain JavaScript - i.e. all other plugins are ignored. I sure don't understand the reason behind this decision. If I wanted the virtual resource to be ignored by the other plugins, I would have prefixed its name myself with |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Expected Behavior
strip()
runs on the code passed.Actual Behavior
This looks like very legitimate code (rollup will output the content of virtual_main eventually). But
strip()
(or SWC, Terser, Babel, or any other plugin that relies on CreateFilter) will be silently ignored, becausevirtual
appends a\x00virtual:
prefix to all files, that then always returns false on CreateFilter.See also bug #749.
Additional Information
As the previous bug suggests, removing the
\x00
on CreateFilter may cause regressions, as well as removing it from virtual (although I'd assume it's a much more reasonable change). If both those ideas are bad, then could I suggest allowing a prefix option to virtual, that allows folks to change this?virtual
seems to be the only official way to support rollup being called with a string (instead of a file), and it's completely broken as is. Without regressing anything, adding a prefix option to virtual and having some documentation that calls out that any filter that has include/exclude doesn't work with the default option sounds better.Beta Was this translation helpful? Give feedback.
All reactions