Open gprieto opened 1 year ago
The current workaround I found is running the build twice:
index.html
to fool crx entry pointnpm run build --mode sveltekit
generates the build with the sveltekit plugin for svelte pages in the build/
foldernpm run build --mode crx
generates the build with the crx plugin for files in manifest in the dist/
foldercp -rf build/ dist/
copies the contents of build/
to dist/
With vite.config.js
:
const config = defineConfig(({ command, mode, ssrBuild }) => {
return {
plugins: (() => {
if (mode === "sveltekit"){
return [sveltekit()]
}
else if (mode === "crx"){
return [crx({ manifest })]
}
else{
return []
}})(),
};
});
export default config;
I'm running into this issue as well, any idea on how one could do the temp fix using UserConfig? I might be missing something but I'm not seeing an api definition for this interface on vite's website
import manifest from './static/manifest.json';
import { crx } from '@crxjs/vite-plugin';
import { sveltekit } from '@sveltejs/kit/vite';
import type { UserConfig } from 'vite';
const config: UserConfig = {
plugins: [sveltekit(), crx({ manifest })],
test: {
include: ['src/**/*.{test,spec}.{js,ts}']
}
};
export default config;
Build tool
Vite
Where do you see the problem?
Describe the bug
When using this vite-plugin with SvelteKit and the
adapter-static
, the build fails with:Reproduction
Using the following vite.config:
and then running
npm build run
Severity
blocking all usage of RPCE