json-theme-even-fork/vite.config.js

42 lines
896 B
JavaScript
Raw Normal View History

2023-01-31 02:37:41 +01:00
import { defineConfig } from 'vite'
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' }
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',
},
plugins: [
dts(),
viteStaticCopy({
targets: [{ src: './schema.d.ts', dest: '.' }],
}),
],
test: {
clearMocks: true,
2023-01-31 02:37:41 +01:00
},
}
2023-01-31 02:37:41 +01:00
})