vite-plugin-chrome-extension icon indicating copy to clipboard operation
vite-plugin-chrome-extension copied to clipboard

empty build being generated when running `vite build --watch`

Open infix opened this issue 3 years ago • 17 comments

Explanation:

when running vite build --watch, it initially builds correctly. However, after the first change to generates an empty build

Codesandbox reproduction: https://codesandbox.io/s/vite-plugin-chrome-extension-watch-build-bug-py0nd?file=/src/main.tsx

Reproduction steps:

  1. open the code sandbox link
  2. run yarn start (vite build --watch) and check the /dist directory. you'll notice that it's built correctly 09
  3. change <div>Hello World</div> in main.tsx to <div>Hello</div>
  4. check the /dist dir again you will notice that only 2 files are generated manifest.js and manifest.json

Build log:

build started...

Find entry files
main: src/main.tsx

✓ 22 modules transformed.
dist/manifest.json        0.13kb
dist/index.html           0.28kb
dist/main.js              0.12kb / brotli: 0.09kb
dist/vendor.6ad9ec51.js   127.61kb / brotli: 36.10kb
built in 6251ms.

build started...

Find entry files
src/manifest.json

✓ 23 modules transformed.
Generated an empty chunk: "manifest"
dist/manifest.json   0.13kb
dist/manifest.js     0.00kb / brotli: 0.00kb
built in 64ms.

Thank you for this great plugin, please let me know if there's anything I can do to help :)

infix avatar May 13 '21 09:05 infix

Indeed --watch option is not available now, and it is in the current work. I will make it work normally as soon as possible.

StarkShang avatar May 18 '21 13:05 StarkShang

Thank you :). if it's possible I'd like to help by contributing code, but I don't know if I'll be free before the weekend

infix avatar May 18 '21 13:05 infix

+1 for this! loving this package but supporting --watch would be perfect

shmarts avatar Jun 22 '21 18:06 shmarts

Any updates on this? Is there any way we could help?

farzadso avatar Jul 08 '21 05:07 farzadso

+1

DavidShefcik avatar Jul 14 '21 22:07 DavidShefcik

@infix Can we please have an update on this?

farzadso avatar Jul 18 '21 17:07 farzadso

Is this issue dead?

farzadso avatar Aug 15 '21 17:08 farzadso

I want to help troubleshoot this but I'm not sure where to start.

floer32 avatar Aug 27 '21 00:08 floer32

If I can help in any way please let me know.

dipsaus9 avatar Aug 27 '21 12:08 dipsaus9

Indeed --watch option is not available now, and it is in the current work. I will make it work normally as soon as possible.

Hello, can you fix this as soon as possible, it would be very useful

Jay214 avatar Sep 01 '21 10:09 Jay214

+1

Hey @StarkShang, it would be great if we can get any update on this. Thanks!

boka18 avatar Oct 14 '21 17:10 boka18

Here is a workaround that seems to work using npm-watch.

In my package.json file I have the following:

  "watch": {
    "build": {
      "patterns": [
        "src"
      ],
      "extensions": "ts,svelte,html",
      "runOnChangeOnly": false
    }
  },
  "scripts": {
    "build": "vite build",
    "watch": "npm-watch"
  },

And then I simply run yarn watch (or npm run watch)

i8ramin avatar Oct 18 '21 01:10 i8ramin

Thanks, @i8ramin Better than nothing.

farzadso avatar Oct 18 '21 05:10 farzadso

I am also interested in this

atwright147 avatar Jan 17 '22 22:01 atwright147

I wasn't happy with the npm-watch solution. @StarkShang I think you are probably very busy or have moved on from this project, but maybe you could point where to where in the code you think I would need to adjust to support --watch and I could potentially open a PR for this? Or even just a rough sketch for how you think you would tackle solving this? Thanks!

mismith avatar Feb 09 '22 18:02 mismith

is there any update on this matter?

McSam94 avatar Apr 09 '22 09:04 McSam94

Looking forward to this feature, when will it be supported?

noahBin23 avatar Apr 19 '22 06:04 noahBin23