sapphi-red / vite-plugin-static-copy

rollup-plugin-copy with dev server support.
MIT License
297 stars 32 forks source link

Support watching file changes with `vite build --watch` #30

Open Tanimodori opened 2 years ago

Tanimodori commented 2 years ago

Currently this plugin does not watch file changes on vite build --watch, the watch related code are serve-only. It would be better to support watching file changes with watched build.

sapphi-red commented 2 years ago

It would be nice to have this feature. But I suppose you can just use rollup-plugin-copy for that.

ivancuric commented 2 years ago

rollup-plugin-copy doesn't support that feature either:

https://github.com/vladshcherbin/rollup-plugin-copy/issues/5

larsactionhero commented 11 months ago

If I understand you right, it is actually possible. For example if you have a .js file, just save it, then build-watch will be triggered and files will be copied to destination folder as defined in vite config..

package.json:

"scripts": {
    "dev": "vite",
    "build": "vite build",
    "build-watch": "vite build --watch --config ./vite.config.js",
  },

Hope that I didn't misunderstand the problem. :)

brianrodri commented 2 weeks ago

rollup-plugin-copy doesn't support that feature either:

vladshcherbin/rollup-plugin-copy#5

Looks like a fork has been made to implements this: https://www.npmjs.com/package/@guanghechen/rollup-plugin-copy