Closed lucasfernandodev closed 2 years ago
The issue must be due to the absolute path provided for outDir
, since as per the docs(https://vitejs.dev/config/build-options.html#build-outdir) outDir
should be a relative path corresponding to the project root. I presume changing the outDir
to the relative path should fix this issue
Also, It would be great if you share your Vite config file so I can able to reproduce this issue.
Thanks, it worked.
vite.config.ts
import {resolve} from 'path';
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import { crx } from "@crxjs/vite-plugin";
import manifest from './manifest.config';
import vitePluginFaviconInject from 'vite-plugin-favicons-inject'
const root = resolve(__dirname, 'src');
const outDir ='../dist';
// https://vitejs.dev/config/
export default defineConfig({
root,
plugins: [react(), crx({ manifest }), vitePluginFaviconInject('./src/public/images/logo.svg')],
build: {
outDir,
emptyOutDir: true,
rollupOptions: {
input: {
main: resolve(root, 'pages', 'popup', 'index.html'),
homepage: resolve(root, 'pages', 'homepage', 'index.html')
}
}
}
})
So I'm getting the error below during the build of the project, the path is duplicated.
In my project using a root and outDir, custom.
Error: