Replies: 2 comments 1 reply
-
Rollup's external option cannot perform rewrites. You can write a custom plugin that parses for The recommended approach is using https://github.com/guybedford/es-module-lexer + https://github.com/Rich-Harris/magic-string which is also used by Vite internally. |
Beta Was this translation helpful? Give feedback.
1 reply
-
You can also use a plugin like this: {
name: 'meteor-globals',
resolveId(id) {
if (id.startsWith('meteor/') return id
},
load(id) {
const match = id.match(/^meteor\/(.+)$/);
const pack = match && match[1];
if (pack) {
return `export default Package[${JSON.stringify(pack)}]`
}
}
} |
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
-
I need to mark some import as an external resource and convert them into a global variable. like this:
Yes, I'm using meteor-client-bundler
Beta Was this translation helpful? Give feedback.
All reactions