Fixed common js
This commit is contained in:
@@ -1,20 +1,16 @@
|
||||
import {resolve} from 'path';
|
||||
import {defineConfig} from 'vite';
|
||||
import dts from 'vite-plugin-dts';
|
||||
|
||||
export default defineConfig({
|
||||
build: {
|
||||
lib: {
|
||||
entry: resolve(process.cwd(), 'src/index.ts'),
|
||||
entry: './src/index.ts',
|
||||
name: 'utils',
|
||||
fileName: (module, entryName) => {
|
||||
if(module == 'es') return 'index.mjs';
|
||||
if(module == 'umd') return 'index.cjs';
|
||||
}
|
||||
fileName: (format) => (format === 'es' ? 'index.mjs' : 'index.js'),
|
||||
},
|
||||
ssr: true,
|
||||
emptyOutDir: true,
|
||||
minify: false,
|
||||
minify: true,
|
||||
sourcemap: true
|
||||
},
|
||||
plugins: [dts()],
|
||||
|
||||
Reference in New Issue
Block a user