JorgenVatle / meteor-vite

⚡ Replace Meteor's bundler with Vite for blazing fast build-times
MIT License
32 stars 10 forks source link

__VUE_... Feature flags not taken into account #123

Closed harry-73 closed 9 months ago

harry-73 commented 9 months ago

Hi,

I tried to put the following in the vite.config.js file:

 export default defineConfig({
  define: {
    __VUE_OPTIONS_API__: 'true',
    __VUE_PROD_DEVTOOLS__: 'false',
    __VUE_PROD_HYDRATION_MISMATCH_DETAILS__: 'true'
  },

...
});

But I still have the follwing warning in the browser console:

Feature flags VUE_OPTIONS_API, VUE_PROD_DEVTOOLS, VUE_PROD_HYDRATION_MISMATCH_DETAILS are not explicitly defined. You are running the esm-bundler build of Vue, which expects these compile-time feature flags to be globally injected via the bundler config in order to get better tree-shaking in the production bundle.

I run meteor like that meteor run

By running meteor run --production, i got the following in the browser console:

Uncaught ReferenceError: __VUE_PROD_DEVTOOLS__ is not defined

JorgenVatle commented 9 months ago

Hey there. 👋

Would you be able to create an example repository that reproduces the issue? I'm running Vue with most of my Meteor projects and can't recall running into this. 👀 If you're running the latest version of meteor-vite, you could downgrading, (meteor-vite@1.9.0 and jorgenvatle:vite-bundler@1.12.8) to see if that makes a difference. The last update had quite a few internal changes.

Either way, if you can set up a repo that reproduces the issue that would be tremendously helpful. 🙏

harry-73 commented 9 months ago

Thanks for your feedback.

By trying to create the repository that reproduces the issue, I realize that the package vuejs:blaze-integration was still in my project (I am migrating from vue2 to vue3. By removing it, all works perfectly.

I use meteor-vite@1.8.0 and jorgenvatle:vite-bundler@1.12.8

sorry for the inconvenience

JorgenVatle commented 9 months ago

Closing issue as fixed. Feel free to re-open if you run into any other issues. 😄