-
Notifications
You must be signed in to change notification settings - Fork 22
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
The plugin doesn't process virtual modules #6
Comments
I guess the problem is that we don't transform proxy modules generated by CommonJS plugin. Try finding the plugin ( rollup-plugin-external-globals/index.js Line 14 in c5f37af
to if (id[0] !== "\0" && !filter(id)) {
return;
} |
With the given modification, the output's header changes to:
|
I have included a minimal environment necessary to reproduce this here (two files above+ minimal package.json): running:
produces test.jsm with the above issues |
You have to use CommonJS plugin before this one. |
It works! Thank you so much! |
Would it be possible to get a release published with the above fix? |
The only problem is that I'm not sure if we should transform all virtual modules ignoring the These options might be able to speed up the build though (e.g. excluding large files). I will push a minor release that transforms all virtual modules. If it breaks something then I guess we will have to fix rollup/rollup-pluginutils#54. |
Thanks a lot! |
Hi! The plugin looks like exactly what I was looking for, but I have not been able to make it work when embedding external modules. I have the following rollup config:
the file
test.js
is the following:I was expecting the plugin to replace imports of 'vue' to the global variable Vue, however, the following happens:
test.jsm
has an import at the very top:import vue from 'vue'
. If I manually replace the import in the generated bundle withconst vue = Vue;
, the resulting bundle works without issue.import Vue from 'vue';
, so the plugin is doing something there...import Vue from "vue"
in test.js, the generated file still includes the import (vuetify also imports it)Note that the plugin works when just importing local code, to the best of my knowledge (it worked when I removed the 'Vuetify' import).
I am unsure why exactly this is happening - my guess is that the commonjs code is processed differently, but I am not sure if that's the issue - it might be something entirely different.
The text was updated successfully, but these errors were encountered: