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

legacy-plugin forces minify (still) #8180

Closed
7 tasks done
phil294 opened this issue May 14, 2022 · 1 comment · Fixed by #8244
Closed
7 tasks done

legacy-plugin forces minify (still) #8180

phil294 opened this issue May 14, 2022 · 1 comment · Fixed by #8244
Labels
p3-minor-bug An edge case that only affects very specific usage (priority) plugin: legacy

Comments

@phil294
Copy link

phil294 commented May 14, 2022

Describe the bug

Very similar to #6266, but this is apparently not fixed yet. legacy does sometimes not respect minify:false and also assetFileNames. With

  plugins: [legacy()],
  build: {
    rollupOptions: {
      output: {
        entryFileNames: '[name].js',
        chunkFileNames: '[name].js',
        assetFileNames: 'assets/[name][extname]',
      },
    },
    minify: false,
  }

the following happens in dist (run npm install && npm run build in the stackblitz repro below):

FILENAME                                 IS MINIFIED      HASHED FILENAME
index.js                                 no               no
index-legacy.js                          yes (ERROR)      no
assets/polyfills-legacy.4ca31241.js      no               yes (ERROR)

See the two ERRORs.

Motivation: Build a VSCode Extension WebView using Vue.js without minification. Here, you need to craft the index.html by hand, that's why the hashes are problematic too.

I realize this is a rather exotic setup and I'll just switch to Webpack for this now, but hopefully this report will help you.

Reproduction

https://stackblitz.com/edit/vitejs-vite-5abiav?file=vite.config.js

System Info

npx envinfo --system --npmPackages '{vite,@vitejs/*}' --binaries --browsers does not output anything on stackblitz, you might want to check that :/ it's a neverending loading ticking cursor.

Anyway, it's

    "@vitejs/plugin-legacy": "^1.8.2",
    "vite": "^2.9.9"

on both stackblitz and local x64 Manjaro Linux. Browser does not play a role here.

Used Package Manager

npm

Logs

No response

Validations

@sapphi-red sapphi-red added p3-minor-bug An edge case that only affects very specific usage (priority) and removed pending triage labels May 20, 2022
@sapphi-red
Copy link
Member

About assets/polyfills-legacy.4ca31241.js, it is a duplicate of #4221.

@github-actions github-actions bot locked and limited conversation to collaborators Jun 4, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
p3-minor-bug An edge case that only affects very specific usage (priority) plugin: legacy
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants