Closed liho00 closed 6 months 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.
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.
Hey any news on this request :) ?
Hey any news on this request :) ?
@Horsty80 just move to Directus is better haha, the best Open source Headless CMS that i ever used!
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/
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/
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.
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 😎
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!
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 :)
Vite is a new breed of frontend build tool that significantly improves the frontend development experience. It consists of two major parts:
A dev server that serves your source files over native ES modules, with rich built-in features and astonishingly fast Hot Module Replacement (HMR).
A build command that bundles your code with Rollup, pre-configured to output highly optimized static assets for production.
In addition, Vite is highly extensible via its Plugin API and JavaScript API with full typing support.