question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Plugin legacy skip emit assets

See original GitHub issue

Describe 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

Issue Analytics

  • State:open
  • Created a year ago
  • Reactions:1
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
marco-pronteracommented, Apr 21, 2022

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.

1reaction
bluwycommented, Apr 21, 2022

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?

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found