aklinker1 / vite-plugin-web-extension

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

Support extensions with only a background script #10

Closed aklinker1 closed 2 years ago

aklinker1 commented 2 years ago

Discovered that this doesn't work when working on the E2E tests, and I made this a test case. Implement and stop skipping the test

_Originally posted by @aklinker1 in https://github.com/aklinker1/vite-plugin-web-extension/pull/9#discussion_r792842855_

aklinker1 commented 2 years ago

Stub your project with a blank html file, and add it to additionalInputs:

<!-- src/stub.html -->
<!-- stub for vite plugin: https://github.com/aklinker1/vite-plugin-web-extension/issues/10 -->
<html></html>

Then in your vite config:

// vite.config.ts
webExtension({
  additionalInputs: ["src/stub.html"]
})
aklinker1 commented 1 year ago

This is supported in V2 (#44) after re-writing the build process.