- ...(isDevelopmentBuild && {
- dir: './lib',
- sourcemap: true,
- entryFileNames: '[name].mjs',
- chunkFileNames: '[name]-[hash].mjs',
- preserveModules: true,
- preserveModulesRoot: './src'
- }),
- ...(!isDevelopmentBuild && {
- file: './lib/index.mjs',
- plugins: [terser({ maxWorkers })]
+ ...(isDevelopmentBuild
+ ? {
+ dir: './lib',
+ entryFileNames: '[name].mjs',
+ chunkFileNames: '[name]-[hash].mjs',
+ preserveModules: true,
+ preserveModulesRoot: './src'
+ }
+ : {
+ file: './lib/index.mjs',
+ plugins: [terser({ maxWorkers })]
+ }),
+ ...(sourcemap && {
+ sourcemap