banner
meanc

meanc

自部署博客在 blog.meanc.cc
twitter
github
discord server

Using chokidar + vite + tailwindcss for real-time development of a component library

I am developing a multi-platform project using a monorepo, and I want to separate the component library into a very lightweight package. I chose Vite for bundling, but it seems that Vite's development mode does not support this feature. If I use tsc to watch for file changes, the output of the build differs from that of vite build, and it does not bundle Tailwind in real-time. Finally, I use chokidar to watch files in the src directory and execute vite build.

  "scripts": {
    "watch-build": "chokidar './src/**/*' -c 'vite build'"
  },
Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.