File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed
Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change 1- import path from 'path' ;
2- import nodeExternals from 'vite-plugin-node-externals' ;
1+ import { externalizeDeps } from 'vite-plugin-externalize-deps' ;
32import dts from 'vite-plugin-dts' ;
43import { defineConfig } from 'vitest/config' ;
54import pkg from './package.json' ;
65
76// https://vitejs.dev/config/
87export default defineConfig ( {
98 plugins : [
10- nodeExternals ( ) ,
9+ externalizeDeps ( ) ,
1110 dts ( {
1211 insertTypesEntry : true ,
1312 } ) ,
@@ -18,12 +17,13 @@ export default defineConfig({
1817 } ,
1918 build : {
2019 lib : {
21- entry : [ 'src/index.ts' , 'src/helpers.ts' ] ,
20+ entry : {
21+ index : 'src/index.ts' ,
22+ helpers : 'src/helpers.ts' ,
23+ } ,
2224 formats : [ 'es' , 'cjs' ] ,
2325 fileName ( format , entryName ) {
24- const ext = format === 'es' ? '.mjs' : '.cjs' ;
25- const basename = path . basename ( entryName , '.ts' ) ;
26- return `${ basename } ${ ext } ` ;
26+ return entryName + ( format === 'es' ? '.mjs' : '.cjs' ) ;
2727 } ,
2828 } ,
2929 modulePreload : false ,
You can’t perform that action at this time.
0 commit comments