R
Refine

ask-any-question

from old refine.dev project with webpack to new with the same data with vite

Eeastern-cyan8/27/2023
Hello everybody! If I want to upgrade my project from an older version from webpack to vite, will everything work faster and can there be problems with this and what is the best thing to do in that case. Also will I just need to create a new project with vite and move the files from the old folder to the new one?
Kkapa.ai8/27/2023
Hi @RomaY. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave: ---------------------- Migrating your project from webpack to Vite can potentially make your development process faster due to Vite's features like native ES modules support, fast build process, and hot module replacement. However, the migration process needs to be done carefully to avoid any issues. Here are the steps you need to follow according to the source (https://refine.dev/blog/what-is-vite-vs-webpack): 1. Install Vite and all its plugins. You can check the getting started guide here (https://vitejs.dev/guide/). 2. Make sure your project is using ES modules. You can do that by going to your package.json file and pasting "type": "module". 3. Remove all webpack configuration files, like webpack.config.js, and replace it with a vite.config.js file. Also in your scripts, you'll need to update with this:
"build": "vite build",
"dev": "vite serve",
"build": "vite build",
"dev": "vite serve",
4. Make sure to remove webpack loaders and plugins that are no longer in use and test your application, so everything is working as it should. You don't necessarily need to create a new project with Vite and move the files from the old folder to the new one. You can directly migrate your existing project by following the steps above. However, it's always a good idea to backup your project before making such changes. Remember, while Vite offers many advantages, it might not be suitable for all projects. It's important to thoroughly test your application after the migration to ensure everything works as expected. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
Kkapa.ai8/27/2023
<@538717491908575242> kapa.ai is still learning and improving, please let us know how it did by reacting below
Eeastern-cyan8/27/2023
ok, thanks, if there are any questions, I will contact you
Ddeep-jade8/28/2023
Hey @RomaY, We changed all example CRA to vite without creating a new project. Changes to the existing project are enough! The PR we changed our examples with can give you an idea: https://github.com/refinedev/refine/pull/4663
Eeastern-cyan8/28/2023
@salihozdemir Great, RAM consumption from react has decreased by 5 times, from 2.5 GB to 0.2~0.5 GB
Ddeep-jade8/28/2023
Great! Happy coding ⚡

Looking for more? Join the community!

R
Refine

ask-any-question

Join Server
Recommended Posts
live update socketHello everyone, how to implement liveProvider and live update if I use socket.io, since I didn't finAPI Response FormatHello, i want to use Inferencer using my API, but my API format looks something like this: ``` { custom edit pageHello, I'm trying to create a edit page from a different path than the standard, trying to adapt my AuthProvider triggeres many times getIdentity()Hello, i'm using Strapi as my backend and I get a lots of API calls that uses method getIdentity() fcannot capture error when authenticatingI'm using refine.dev with strapi for login and data access. How can I capture login error ? My autGetting StartedHow do I get startedHow to transform a value before it gets sent for a resource updateHi all! As the title states, I would like to know what the best practice is for transforming a valuuseEditable table without traditional save buttonFrom fine foods we can see how to make edits, but how can we achieve samething when we have to patchcustom authProvider - Passing API UrlHi! I currently have a custom authProvider that queries the /auth/login endpoint of my API. Right nhow to remove default valuesrewriting my own login.tsx, i have a code like this <TextField {...register("page titlewhat is the best way in a component to render the page title attribute ?default language for applicationhello, I need to change the default language for the application from English to Italian. I have alruseTable Custom API Endpoint?Hi! I'd like to use some functionalities of useTable (namely, onSearch), but using a custom API endinvalid hook call errorHi, using refine.dev (vite) I'm trying to "preload" data from UseList In order to do that, i'm tryiDoes self-hosted open-source Refine comes with all features?I'm a bit confused about these pages: 1. https://refine.dev/docs/comparison/ 2. https://refine.dev/phello guys can you tell me how to setuphello guys, can you tell me how to setup casl in react refine dev with access control provider ?useAutocomplete Server Side PaginationI have a controller that renders an autocomplete component. I am using the useAutocomplete hook to gMUI Inferencer Can't Detect Object Inside EntitySo I have the MUI Inferencer working well enough to detect some of my entity fields, but for some re