strapi / rfcs

RFCs for Strapi future changes
68 stars 33 forks source link

Request — Replace webpack with vite #30

Closed liho00 closed 6 months ago

liho00 commented 3 years ago

Vite is a new breed of frontend build tool that significantly improves the frontend development experience. It consists of two major parts:

In addition, Vite is highly extensible via its Plugin API and JavaScript API with full typing support.

soupette commented 3 years ago

@liho00 thank you for opening this issue.

Currently, we stick with webpack 5 in order to build the plugins in the v4. However, no decisions has been taken regarding plugins development.

emahuni commented 1 year ago

Hi guys

I think Strapi team should really consider this strongly. Vite is blazing fast and what's more it works directly with ts during dev, meaning there is no build step. It's HMR is soooo good that changes are updated nearly instantly during development. I don't need to say much about it, just research on it compare it to webpack. It's worth it.

Horsty80 commented 1 year ago

Hey any news on this request :) ?

liho00 commented 1 year ago

Hey any news on this request :) ?

@Horsty80 just move to Directus is better haha, the best Open source Headless CMS that i ever used!

jclaveau commented 1 year ago

Vite is also the foundation of Vitest which is just the exact same thing as Jest (It uses the same API and Jest plugins work with it) but with a much better dev experience (Faster and direct TS support): https://vitest.dev/

rrfaria commented 1 year ago

maybe using swc with webpack could speed up parts of compiling time: https://swc.rs/docs/usage/swc-loader https://blog.logrocket.com/migrating-swc-webpack-babel-overview/

joshuaellis commented 1 year ago

A small update – we're beginning to explore this space, there's a lot of pieces to the puzzle so don't expect a solid update for some time.

joshuaellis commented 10 months ago

Hey everyone, i'm very pleased to announce there's an RFC on vite – https://github.com/strapi/rfcs/pull/54

Feel free to give it a read and leave any feedback or just show your excitement 😎

joshuaellis commented 7 months ago

Hey hey, few steps closer! There's now an experimental version available – it's based on the develop branch of the product so there may be bugs. BUT if anyone's feel adventurous over the festive season, feel free to give it a go. You will get peer-dep warnings because it doesn't follow semver, these can be safely ignored :)

npx create-strapi-app@0.0.0-experimental.e28520c3d3ad22e806666fb4e3cc049c1d14345e

However you'll want to run a develop or build command with the bundler argument like this example:

yarn develop --watch-admin --bundler=vite

This will inject the vite middleware too for HMR. If you don't use --bundler=vite you're just using webpack!

joshuaellis commented 6 months ago

We've merged this PR, it will be releases as experimental opt-in from 4.17.1 if you give it a go & find issues, please write an issue on the main repo for us to look at! From V5, we'd like to make this the default bundler but keep webpack to ease the transition :)