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

@vitejs/plugin-vue not merge feature flag __VUE_PROD_DEVTOOLS__ from vite config #5967

Closed
7 tasks done
namepain opened this issue Dec 5, 2021 · 4 comments · Fixed by #6072
Closed
7 tasks done

@vitejs/plugin-vue not merge feature flag __VUE_PROD_DEVTOOLS__ from vite config #5967

namepain opened this issue Dec 5, 2021 · 4 comments · Fixed by #6072

Comments

@namepain
Copy link

namepain commented Dec 5, 2021

Describe the bug

when define global feature flag VUE_PROD_DEVTOOLS in vite config, still can not support devtool in production.

Reproduction

vite config:

plugins: [
    vue(),
],
define: {
    __VUE_PROD_DEVTOOLS__: true,
},

It seems that plugin-vue do not merge global feature flag from vite define
https://github.com/vitejs/vite/blob/main/packages/plugin-vue/src/index.ts#L129

System Info

@vitejs/plugin-vue@1.10.1

Used Package Manager

yarn

Logs

No response

Validations

@jonaskuske
Copy link
Contributor

plugins: [
    vue(),
    {
      config() {
        return { define: {  __VUE_PROD_DEVTOOLS__: true }  }
      },
    },
],

should work as a workaround

@ydcjeff
Copy link
Contributor

ydcjeff commented Dec 9, 2021

Caused by #5155

@ATaoyoyo
Copy link

plugins: [
    vue(),
    {
      config() {
        return { define: {  __VUE_PROD_DEVTOOLS__: true }  }
      },
    },
],

should work as a workaround

I try to this... but it does't work

@jonaskuske
Copy link
Contributor

I try to this... but it does't work

Just tested it, it does work. Maybe you have another conflicting plugin that overwrites the define option? Make sure

    {
      config() {
        return { define: {  __VUE_PROD_DEVTOOLS__: true }  }
      },
    },

comes last in your plugin list.

@github-actions github-actions bot locked and limited conversation to collaborators Dec 27, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants