Plugin legacy skip emit assets
See original GitHub issueDescribe the bug
Hi guys, the latest version of the legacy plugin, no longer issues assets. This does not allow some plugins I use to apply logic even to the generated legacy bundle.
The line is this:
opts.__vite_skip_asset_emit__ = true
I think it is more appropriate to give the possibility to decide by means of a parameter. Obviously, you can set it to true by default in order to skip.
That would be great, thank you in advance, and thank you for your work ❤️.
Reproduction
All
System Info
All
Used Package Manager
npm
Logs
No logs
Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn’t already an issue that reports the same bug to avoid creating a duplicate.
- Make sure this is a Vite issue and not a framework-specific issue. For example, if it’s a Vue SFC related bug, it should likely be reported to https://github.com/vuejs/core instead.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
- The provided reproduction is a minimal reproducible example of the bug.
Issue Analytics
- State:
- Created a year ago
- Reactions:1
- Comments:5 (2 by maintainers)
Top Results From Across the Web
@vitejs/plugin-legacy - npm
Generate a corresponding legacy chunk for every chunk in the final bundle, transformed with @babel/preset-env and emitted as SystemJS modules ( ...
Read more >Migration from v3 - Vite
Vite is now using Rollup 3, which allowed us to simplify Vite's internal asset handling and has many improvements. See the Rollup 3...
Read more >Getting started with Plastic SCM - Unity - Manual
Installing the Plastic SCM plugin for Unity · Navigate to your Assets/Plugins folder in your Unity Project. Delete the PlasticSCM folder. · Re-open...
Read more >Shimming - webpack
[webpack-cli] Compilation finished asset main.js 69.1 KiB [emitted] [minimized] (name: main) 1 ... Some legacy modules rely on this being the window object....
Read more >Documentation - tsc CLI Options - TypeScript
Flag Type Default
‑‑allowJs boolean false
‑‑allowUmdGlobalAccess boolean false
‑‑allowUnreachableCode boolean
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks, I knew about the configuration through Vite, but in this case, I cannot choose the details. I would also need to inject code that comes from “dynamic” sources, I have a custom version that allows me to optimize a product through the build phase, taking some style and putting it directly in the build (even legacy build). But for now, I have to use a custom (local) version of the legacy plugin with the modification proposed in PR.
Thanks for providing your usecase. I tested this on stackblitz and it seems to be working fine in a different way. It looks like Vite already inlines css in legacy with this code
https://github.com/vitejs/vite/blob/1d468c8e6f02b0d0e362aa2d6542af1e1f55ab45/packages/vite/src/node/plugins/css.ts#L459-L468
so maybe it’s not needed for the plugin to handle it?