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

use virtual module prefix to play nice with other plugins #3

Merged
merged 2 commits into from
Sep 19, 2016

Conversation

Rich-Harris
Copy link
Contributor

Notwithstanding our separate conversations about consolidating some of the node- plugins, I just ran into an issue while trying to fix rollup/rollup-plugin-commonjs#90, which is that other plugins might try to resolve IDs like __filename depending on the plugin order (and in the case of rollup-plugin-node-resolve, that blows up).

The 'convention' (albeit not very well documented etc) with other plugins that use virtual modules is to prefix module IDs with \0, or even \0mypluginname: – this prevents other plugins from trying to resolve those IDs (the logic is built into createFilter, for example). \0 works because it's not a legal character in file names.

@calvinmetcalf
Copy link
Owner

we should probaby name space this just in case

@calvinmetcalf
Copy link
Owner

probaby makes sense to name space it, otherwise seems like a good ides

@Rich-Harris
Copy link
Contributor Author

done 👍

@calvinmetcalf
Copy link
Owner

thanks published as 1.0.8

This was referenced May 25, 2019
@kuraga
Copy link

kuraga commented May 25, 2019

The 'convention' (albeit not very well documented etc) with other plugins that use virtual modules is to prefix module IDs with \0

@Rich-Harris , could you remember, please, where this convention is introduced and documented? Because now we have #23 and #18 .

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

Successfully merging this pull request may close these issues.

'import' and 'export' may only appear at the top level
3 participants