lib.fileName instead output.entryFileNames

This commit is contained in:
草鞋没号 2022-02-04 00:21:19 +08:00
parent 8a7132af34
commit d3db7251e5

View File

@ -12,6 +12,7 @@ export default defineConfig({
lib: { lib: {
entry: 'index.ts', entry: 'index.ts',
formats: ['cjs'], formats: ['cjs'],
fileName: () => '[name].cjs',
}, },
minify: process.env.NODE_ENV === 'production', minify: process.env.NODE_ENV === 'production',
emptyOutDir: true, emptyOutDir: true,
@ -21,9 +22,6 @@ export default defineConfig({
...builtinModules, ...builtinModules,
...Object.keys(pkg.dependencies || {}), ...Object.keys(pkg.dependencies || {}),
], ],
output: {
entryFileNames: '[name].cjs',
},
}, },
}, },
}) })