crxjs / chrome-extension-tools

Bundling Chrome Extensions can be pretty complex. It doesn't have to be.
https://crxjs.dev/vite-plugin
2.75k stars 182 forks source link

Can't build the extension for production which has both popup pages and tabs page #694

Closed DengSihan closed 1 year ago

DengSihan commented 1 year ago

Build tool

Vite

Where do you see the problem?

Describe the bug

I'm developing a extension which has both popup page and tabs page.

When in develop mode (yarn dev), everything works fine.

But when I try to build for production:

  1. yarn build can't works correctly, only typescript tips were printed on the console image (At the tail of the messages: error Command failed with exit code 1.)
  2. I try to build for production without tsc: yarn vite build image the process was done, but the build can't be accessiable image

Reproduction

miniest reproduction

Logs

No response

System Info

Windows 10 pro

node v16.18.1

yarn v1.22.19

Severity

annoyance

jacksteamdev commented 1 year ago

Thanks for including a reproduction! Looking at the package.json, the build script is for vue-tsc not vite, so what you're seeing for yarn build is probably expected and not a CRXJS issue.

HTML Pages in CRXJS

The manifest needs to include a action key to include the popup, there's an example in the Google Developer docs.

If you want to use HTML pages that aren't in the manifest, you can follow these instructions to include them in the build.