Comments (4)
Yes this plugin has some strange behaviour if the files are coming from the project source or from the monorepo. I will remove this in the next major.
The "problem" of network is in fact not one: https://github.com/ArnaudBarre/esm-dev-server-limit
This is just showing that processing files is slow, but the network is not the issue in local.
If you're not using Babel plugins, I would advice to try the SWC plugin, which should allow you to use your ui package as if they were in your app source code with fast refresh and faster cold start
from vite-plugin-react.
Hi!
That's interesting to see someone using optimizeDeps
for source code. This is not officially supported cc @patak-dev
I just tested and this make all the @ui package totally stale without a restart --force.
What is the goal of this optimisation? Are hitting some performance issue on a large project?
from vite-plugin-react.
I have a use case for this since I recently extracted common UI components in https://github.com/a-type/gnocchi into a packages/ui
shared module in my monorepo. The way I have things set up, shared packages are loaded as TS source directly using composite projects, not transpiled.
Moving the UI components into a separate module has proved problematic, since now each individual module file is being loaded over the network all at once on a page reload, causing a request waterfall/bottleneck during development. I was hoping to be able to combine all these into one request.
I'm not really sure how this behavior differs from what happens if those files were back in the original app source directory, but I definitely noticed the change after moving them.
from vite-plugin-react.
We re-discussed with the team the idea of prebundling for source code. We are not sure now about a support in core but @antfu is experimenting with this https://github.com/antfu/vite-plugin-prebundle. You can try it out and follow the progress!
from vite-plugin-react.
Related Issues (20)
- vite hot reloading does not work with server side streaming with renderToPipeableStream [react 18] HOT 3
- Uncaught Error: @vitejs/plugin-react can't detect preamble. Something is wrong. HOT 1
- Types for plugins fails with Native ESM HOT 5
- SSR example misuses React Router v6 HOT 2
- Make plugin-transform-react-jsx-self and plugin-transform-react-jsx-source optional HOT 2
- Using JSX inside a constructor before calling `super` will crash at runtime HOT 3
- Error Boundary issue. HOT 3
- lineNumber error for __source prop HOT 3
- Uncaught SyntaxError: The requested module '/node_modules/prop-types/index.js?v=cf7fa801' does not provide an export named 'default HOT 2
- HMR Invalidate when exporting custom hooks HOT 2
- Uncaught SyntaxError: The requested module '/node_modules/prop-types/index.js?v=cf7fa801' does not provide an export named 'default HOT 3
- Update plugin to the new version of Vite 5.x HOT 12
- [bug]:at the time of installing the react vite app,it is not runnit HOT 1
- Babel reformats the input file, causing source references to be wrong HOT 8
- Decorators not working with React class components HOT 2
- Vite react-admin browser dev tools freeze (100% CPU) HOT 2
- React hooks reran on every edit HOT 6
- Error when using block comments in JSX: "repeat count must be non-negative" HOT 2
- Errors in react App.tsx file HOT 2
- Having "react" in optimizeDeps.include creates problems when "react" is externalized HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vite-plugin-react.