Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

empty build being generated when running vite build --watch #6

Open
infix opened this issue May 13, 2021 · 17 comments · May be fixed by #36
Open

empty build being generated when running vite build --watch #6

infix opened this issue May 13, 2021 · 17 comments · May be fixed by #36
Labels
enhancement New feature or request

Comments

@infix
Copy link

infix commented May 13, 2021

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 :)

@StarkShang
Copy link
Owner

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

@infix
Copy link
Author

infix commented May 18, 2021

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

@StarkShang StarkShang added the enhancement New feature or request label May 18, 2021
@shmarts
Copy link

shmarts commented Jun 22, 2021

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

@farzadso
Copy link

farzadso commented Jul 8, 2021

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

@DavidShefcik
Copy link

+1

@farzadso
Copy link

@infix Can we please have an update on this?

@farzadso
Copy link

Is this issue dead?

@floer32
Copy link

floer32 commented Aug 27, 2021

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

@dipsaus9
Copy link

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

@Jay214
Copy link

Jay214 commented Sep 1, 2021

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

@boka18
Copy link

boka18 commented Oct 14, 2021

+1

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

@i8ramin
Copy link

i8ramin commented Oct 18, 2021

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)

@farzadso
Copy link

Thanks, @i8ramin
Better than nothing.

yto60 added a commit to yto60/notion-replace-text that referenced this issue Jan 1, 2022
yto60 added a commit to yto60/notion-replace-text that referenced this issue Jan 4, 2022
@atwright147
Copy link

I am also interested in this

@mismith
Copy link

mismith commented Feb 9, 2022

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!

@McSam94
Copy link

McSam94 commented Apr 9, 2022

is there any update on this matter?

@noahBin23
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.