vitejs / vite-plugin-vue

Vite Vue Plugins
MIT License
504 stars 155 forks source link

["__file","*/component.vue"] is added in vite build #410

Closed RuthrapathyR closed 6 months ago

RuthrapathyR commented 6 months ago

Related plugins

Describe the bug

On trying vite build for my vue project in my build.js file i get ["__file","path to my vue componenents"] which is not required please help how to remove that from my build.also referred #11191 this issue which is same as this,tried the solution they gave but it is not working as expected please help.

the solution i tried(not working): 'process.env.NODE_ENV': JSON.stringify('production') added this under definConfig's define object in vite.config.ts .

Reproduction

no url

Steps to reproduce

No response

System Info

System:
    OS: macOS 14.4.1
    CPU: (8) arm64 Apple M1 Pro
    Memory: 290.58 MB / 16.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 21.6.1 - /opt/homebrew/bin/node
    npm: 10.2.4 - /opt/homebrew/bin/npm
  Browsers:
    Brave Browser: 124.1.65.130
    Chrome: 124.0.6367.202
    Safari: 17.4.1
  npmPackages:
    @vitejs/plugin-vue: ^4.1.0 => 4.1.0 
    vite: ^4.5.3 => 4.5.3

Used Package Manager

npm

Logs

No response

Validations

sxzz commented 6 months ago

Try to set environment variable NODE_ENV=production in your shell/terminal instead of vite config.