-
-
Notifications
You must be signed in to change notification settings - Fork 7.4k
Closed
Labels
contribution welcomep3-minor-bugAn edge case that only affects very specific usage (priority)An edge case that only affects very specific usage (priority)
Description
Describe the bug
Using vite-plugin-web-extension to create a web extension, I happened upon very strange behavior. Namely,
- files would sometimes be produced at incorrect paths (i.e. if
src/popup/popup.html, then output atdist/popup.html - some files would get content like
export default "/popup.html" - error messages like:
Generated an empty chunk: "popup/popup"
"popup.html" overwrites a previously emitted file of the same name
The fix for this behavior was to remove the following line from my vite.config.ts (which was there as a placeholder):
assetsInclude: []
Reproduction
https://github.com/colearendt/extensions-example
Steps to reproduce
npm run build- notice there is a
dist/popup.htmlfile with contents:export default "/popup.html"% - remove the
assetsInclude: []line fromvite.config.ts - Build and notice
dist/popup.htmlhas expected contents
System Info
System:
OS: macOS 12.2.1
CPU: (10) arm64 Apple M1 Pro
Memory: 91.50 MB / 32.00 GB
Shell: 5.8 - /bin/zsh
Binaries:
Node: 16.15.1 - ~/.nvm/versions/node/v16.15.1/bin/node
Yarn: 1.22.18 - /opt/homebrew/bin/yarn
npm: 8.11.0 - ~/.nvm/versions/node/v16.15.1/bin/npm
Browsers:
Brave Browser: 104.1.42.88
Chrome: 107.0.5304.110
Firefox: 106.0.5
Safari: 15.3
npmPackages:
@vitejs/plugin-vue: ^3.2.0 => 3.2.0
vite: ^3.2.3 => 3.2.3Used Package Manager
npm
Logs
npm run build
> extension-example@0.0.0 build
> vue-tsc && vite build
vite v3.2.3 building for production...
[vite-plugin-web-extension]
Building HTML Pages in Multi-Page Mode:
• src/popup.html
Building in Lib Mode:
• (none)
[vite-plugin-web-extension] Building HTML Pages in Multi-Page Mode
✓ 1 modules transformed.
Generated an empty chunk: "popup"
rendering chunks (1)...The emitted file "popup.html" overwrites a previously emitted file of the same name.
../dist/assets/vue.svg 0.48 KiB
../dist/manifest.json 0.28 KiB
../dist/popup.html 0.03 KiB
Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- Make sure this is a Vite issue and not a framework-specific issue. For example, if it's a Vue SFC related bug, it should likely be reported to vuejs/core instead.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
- The provided reproduction is a minimal reproducible example of the bug.
Metadata
Metadata
Assignees
Labels
contribution welcomep3-minor-bugAn edge case that only affects very specific usage (priority)An edge case that only affects very specific usage (priority)