samrum / vite-plugin-web-extension

A vite plugin for generating cross browser platform, ES module based web extensions.
MIT License
323 stars 33 forks source link

Property 'name' does not exist on type 'EmittedPrebuiltChunk' #125

Open rmrfxyz opened 1 year ago

rmrfxyz commented 1 year ago

I forked the repo and I am not able to build or run; fails as such:

rollup v3.27.0
bundles src/index.ts → dist/index.cjs, dist/index.mjs...
(!) Plugin typescript: @rollup/plugin-typescript TS2339: Property 'name' does not exist on type 'EmittedFile'.
  Property 'name' does not exist on type 'EmittedPrebuiltChunk'.
src/index.ts: (69:49)

69         this.addWatchFile(file.fileName ?? file.name!);
                                                   ~~~~

created dist/index.cjs, dist/index.mjs in 660ms

[2023-07-30 17:55:27] waiting for changes...
^C ELIFECYCLE  Command failed.

I tried to import EmittedPrebuiltChunk in src/index.ts but that resulted in more errors:

rollup v3.27.0
bundles src/index.ts → dist/index.cjs, dist/index.mjs...
(!) Plugin typescript: @rollup/plugin-typescript TS2339: Property 'concat' does not exist on type 'EmittedPrebuiltChunk | EmittedFile[]'.
  Property 'concat' does not exist on type 'EmittedPrebuiltChunk'.
src/index.ts: (61:29)

61       emitQueue = emitQueue.concat(emitFiles);
                               ~~~~~~

(!) Plugin typescript: @rollup/plugin-typescript TS2339: Property 'forEach' does not exist on type 'EmittedPrebuiltChunk | EmittedFile[]'.
  Property 'forEach' does not exist on type 'EmittedPrebuiltChunk'.
src/index.ts: (67:17)

67       emitQueue.forEach((file) => {
                   ~~~~~~~

(!) Plugin typescript: @rollup/plugin-typescript TS7006: Parameter 'file' implicitly has an 'any' type.
src/index.ts: (67:26)

67       emitQueue.forEach((file) => {
                            ~~~~

created dist/index.cjs, dist/index.mjs in 655ms

[2023-07-30 17:59:40] waiting for changes...

Am I missing something? 🤔

Thanks for publishing this, it's perfect for my plans! Great work!