You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello,
I am using vite with react & viteRails.
I don't think the plugin legacy works as expected trying to include replaceAll and in Chrome 84 version it doesn't work.
My project was using babel: { "presets": ["@babel/preset-env", "@babel/preset-react"], "plugins": [ "@babel/plugin-syntax-dynamic-import", "@babel/plugin-proposal-class-properties", "@babel/plugin-transform-runtime" ] }
which I completely removed all babel in favor to plugin/legacy which kind of uses under the hood already.
I checked other relevant issues(issue 1, issue 2) about replaceAll since it's not included in the legacy by default.
So I used this configuration in my plugin/legacy. Not sure if this open issue is related.
This configuration doesn't work for Chrome 84
I ended up including a polufill.io in the head to include replaceAll so that my project can run in older browser versions.
I want to know if vite_plugin_legacy covers also the node_module libraries usages for older browsers.
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 vuejs/core instead.
alexookah
changed the title
Plugin legacy is not working as expected for node_module libraries
Plugin legacy is not working as expected for replaceAll
Dec 8, 2023
You are right! it works with vite_preview.
Actually I come from vite_rails where they also support vite_legacy but probably it's not the same outcome.
In a Vue project it works correctly but with rails it's different vite legacy gets used with some html tag.
I'll close this for now as it seems to be an integration issue with vite_ruby. @vitejs/plugin-legacy might not always work with frameworks as different frameworks may bundle things differently.
Describe the bug
Hello,
I am using
vite
withreact
&viteRails
.I don't think the plugin legacy works as expected trying to include replaceAll and in Chrome 84 version it doesn't work.
I use a library in my project called camelCaseKeys.
This library depends on camelCase which has a function
replaceAll
.My project was using babel:
{ "presets": ["@babel/preset-env", "@babel/preset-react"], "plugins": [ "@babel/plugin-syntax-dynamic-import", "@babel/plugin-proposal-class-properties", "@babel/plugin-transform-runtime" ] }
which I completely removed all babel in favor to plugin/legacy which kind of uses under the hood already.
I checked other relevant issues(issue 1, issue 2) about replaceAll since it's not included in the legacy by default.
So I used this configuration in my plugin/legacy. Not sure if this open issue is related.
This configuration doesn't work for Chrome 84
I ended up including a polufill.io in the head to include replaceAll so that my project can run in older browser versions.
I want to know if
vite_plugin_legacy
covers also thenode_module
libraries usages for older browsers.Reproduction
https://stackblitz.com/edit/vitejs-vite-cgggur?file=vite.config.js
Steps to reproduce
Created also a stackBlitz repro project: https://stackblitz.com/edit/vitejs-vite-cgggur?file=vite.config.js
System Info
Used Package Manager
yarn
Logs
No response
Validations
The text was updated successfully, but these errors were encountered: