webapp-prerender/vite.config.ts

39 lines
989 B
TypeScript

import { resolve } from 'path';
import { defineConfig } from 'vite';
import dts from 'vite-plugin-dts';
export default defineConfig({
plugins: [
dts({
exclude: ['src/run.ts'],
}),
],
build: {
outDir: 'dist',
emptyOutDir: true,
target: 'node20',
lib: {
entry: {
'index': resolve(__dirname, 'src/index.ts'),
'run': resolve(__dirname, 'src/run.ts'),
},
//formats: ['es'],
},
minify: false,
rollupOptions: {
external: [
/node:.*/,
'express', 'puppeteer',
'async-mutex', 'serve-static',
'send', 'html-minifier',
'unconfig',
],
output: {
manualChunks: {
'run': ['src/run.ts'],
'index': ['src/index.ts'],
}
},
},
},
});