Open lopo12123 opened 9 months ago
add publicDir: 'public',
in your vite.config.ts
e.g.
export default defineConfig(({ mode }) => {
return {
publicDir: 'public',
build: {
emptyOutDir: true,
outDir: 'build',
........
use latest version 0.8.7
add
publicDir: 'public',
in your vite.config.tse.g.
export default defineConfig(({ mode }) => { return { publicDir: 'public', build: { emptyOutDir: true, outDir: 'build', ........
use latest version
0.8.7
@lopo12123
@guocaoyi Hi there, i'm sure it's not a problem with the publicDir
setting, because it defaults to 'public' (I don't need to set it at all). Maybe you can try to reproduce it using the following situation...
Neither example.txt file is copied to the build folder (unless I specify it in web_accessible_resources.resources
in manifest.ts
)
In the picture below, I specified example.txt under public, and you can see that it was copied to build, but icons/example.txt
was not (because I did not specify it in web_accessible_resources.resources
)
Then I specified two example.txt, and you can see that they are now copied.
Ok, thanks for the clarification.
lopo12123 @.***> 于2023年10月8日周日 10:02写道:
I'm sure it's not a problem with the publicDir setting, because it defaults to 'public'. So I don't need to set it at all.
Neither example.txt file is copied to the build folder (unless I specify it in web_accessible_resources.resources in manifest.ts)
[image: image] https://user-images.githubusercontent.com/59609929/273420741-f85499e2-d05a-4e75-90c0-fe086a308e1e.png
In the picture below, I specified example.txt under public, and you can see that it was copied to build, but icons/example.txt was not (because I did not specify it in web_accessible_resources.resources) [image: image] https://user-images.githubusercontent.com/59609929/273420771-4081488f-47c4-47ed-853f-8726aed90fae.png [image: image] https://user-images.githubusercontent.com/59609929/273420877-ea361139-dbb9-4d7d-951d-3503ef04eedd.png
Then I specified two example.txt, and you can see that they are now copied. [image: image] https://user-images.githubusercontent.com/59609929/273420910-ee60a5ff-a7bb-466f-9c83-51881879b65f.png [image: image] https://user-images.githubusercontent.com/59609929/273420898-f0dfe809-0cd0-4c72-a197-a1b9b9e09818.png
— Reply to this email directly, view it on GitHub https://github.com/guocaoyi/create-chrome-ext/issues/48#issuecomment-1751892321, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJ7C2FPJOIQYF74UXVRN6QTX6ICUTAVCNFSM6AAAAAA5VYQXXOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONJRHA4TEMZSGE . You are receiving this because you modified the open/close state.Message ID: @.***>
The content under
public
was not copied to thebuild
directory. When I was developing, there was a wasm file that needed to be loaded asynchronously (using fetch in background.js), but when I started dev, it did not seem to be copied to In the build directory, I need to assign values manually. Did I miss something to configure?