aklinker1 / vite-plugin-web-extension

Vite plugin for developing Chrome/Web Extensions
https://vite-plugin-web-extension.aklinker1.io/
MIT License
654 stars 57 forks source link

stuck in "restarting browser" after content-script changed #162

Closed jcc1997 closed 11 months ago

jcc1997 commented 1 year ago

Summary

stuck in "restarting browser" after content-script changed

Reproduction

reproduction repo

Environment

  System:
    OS: macOS 13.1
    CPU: (8) x64 Intel(R) Core(TM) i5-1038NG7 CPU @ 2.00GHz
    Memory: 456.36 MB / 16.00 GB
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 18.18.2 - ~/.nvm/versions/node/v18.18.2/bin/node
    npm: 9.8.1 - ~/.nvm/versions/node/v18.18.2/bin/npm
    pnpm: 8.9.2 - ~/.nvm/versions/node/v18.18.2/bin/pnpm
  Browsers:
    Chrome: 111.0.5563.146
    Edge: 111.0.1661.51
    Safari: 16.2
  npmPackages:
    vite: ^5.0.0 => 5.0.3 
    vite-plugin-web-extension: ^4.0.0 => 4.0.0
aklinker1 commented 11 months ago

Interesting, thanks for the report. For me, its not "stuck", but it does report files in the "dist" directory as changed when those aren't relevant to reloading the extension in dev mode. Should just need to ignore file changes in the output directory with Vite 5.

src/content-script.ts changed, restarting browser

build started...
✓ 0 modules transformed.
dist/src/content-script.js  0.23 kB │ gzip: 0.19 kB
built in 5ms.
Last extension reload: 23:21:43 GMT-0600 (Central Standard Time)

dist/icon/128.png changed, restarting browser

dist/icon/16.png changed, restarting browser

dist/icon/32.png changed, restarting browser

dist/icon/48.png changed, restarting browser

dist/icon/96.png changed, restarting browser

dist/icon-with-shadow.svg changed, restarting browser

dist/src/content-script.js changed, restarting browser
aklinker1 commented 11 months ago

Release fix in v4.0.1. Let me know if it doesn't work for you.