2023-01-31 02:37:41 +01:00
|
|
|
import { defineConfig } from 'vite'
|
2023-09-28 02:50:43 +02:00
|
|
|
import dts from 'vite-plugin-dts'
|
|
|
|
import { viteStaticCopy } from 'vite-plugin-static-copy'
|
2023-01-31 02:37:41 +01:00
|
|
|
import pkg from './package.json' assert { type: 'json' }
|
|
|
|
|
2023-09-15 03:40:25 +02:00
|
|
|
export default defineConfig(({ mode }) => {
|
|
|
|
if (mode === 'development') {
|
|
|
|
return {
|
|
|
|
build: {
|
|
|
|
outDir: './public',
|
|
|
|
target: 'esnext',
|
|
|
|
},
|
|
|
|
publicDir: false,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return {
|
|
|
|
build: {
|
|
|
|
copyPublicDir: false,
|
|
|
|
lib: {
|
|
|
|
entry: './index.js',
|
|
|
|
fileName: 'index',
|
|
|
|
formats: ['es', 'cjs', 'umd'],
|
|
|
|
name: 'jsonresumeThemeEven',
|
|
|
|
},
|
|
|
|
rollupOptions: {
|
|
|
|
external: [...Object.keys(pkg.dependencies), /^node:.*/],
|
|
|
|
},
|
|
|
|
target: 'esnext',
|
2023-09-28 02:50:43 +02:00
|
|
|
},
|
|
|
|
plugins: [
|
|
|
|
dts(),
|
|
|
|
viteStaticCopy({
|
|
|
|
targets: [{ src: './schema.d.ts', dest: '.' }],
|
|
|
|
}),
|
|
|
|
],
|
|
|
|
test: {
|
|
|
|
clearMocks: true,
|
2023-01-31 02:37:41 +01:00
|
|
|
},
|
2023-09-15 03:40:25 +02:00
|
|
|
}
|
2023-01-31 02:37:41 +01:00
|
|
|
})
|