34 lines
868 B
TypeScript
34 lines
868 B
TypeScript
/// <reference types="vitest/config" />
|
|
import { defineConfig } from 'vite'
|
|
import { nodePolyfills } from 'vite-plugin-node-polyfills';
|
|
import { resolve } from 'node:path';
|
|
import dts from 'vite-plugin-dts';
|
|
|
|
let basePath = process.env.basePath ?? '';
|
|
|
|
// https://vite.dev/config/
|
|
export default defineConfig({
|
|
base: basePath,
|
|
plugins: [
|
|
nodePolyfills(),
|
|
dts({rollupTypes: true, tsconfigPath: './tsconfig.app.json',insertTypesEntry: true}),
|
|
],
|
|
build: {
|
|
modulePreload: {
|
|
resolveDependencies() {
|
|
return [];
|
|
}
|
|
},
|
|
lib: {
|
|
entry: resolve(__dirname, 'src/index.ts'),
|
|
name: 'MesCutorder',
|
|
fileName(format) {
|
|
return `mes-cutorder.${format}.js`
|
|
},
|
|
formats: ['es', 'umd', 'iife']
|
|
}
|
|
},
|
|
esbuild: {
|
|
drop: process.env.NODE_ENV === 'production' ? ['console', 'debugger'] : [],
|
|
},
|
|
}) |