Git Product home page Git Product logo

Comments (4)

ArnaudBarre avatar ArnaudBarre commented on June 12, 2024 1

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.

ArnaudBarre avatar ArnaudBarre commented on June 12, 2024

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.

a-type avatar a-type commented on June 12, 2024

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.

ArnaudBarre avatar ArnaudBarre commented on June 12, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.