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