repositories
/
poolifier.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
build(deps-dev): bump @types/node
[poolifier.git]
/
rollup.config.mjs
diff --git
a/rollup.config.mjs
b/rollup.config.mjs
index 8f1f26562a4817d75a018129b3a09f76fd9129ab..d4af3f3ff624310388649f22934a60e7cf867d18 100644
(file)
--- a/
rollup.config.mjs
+++ b/
rollup.config.mjs
@@
-24,6
+24,7
@@
const availableParallelism = () => {
const isDevelopmentBuild = env.BUILD === 'development'
const isAnalyzeBuild = env.ANALYZE
const isDocumentationBuild = env.DOCUMENTATION
const isDevelopmentBuild = env.BUILD === 'development'
const isAnalyzeBuild = env.ANALYZE
const isDocumentationBuild = env.DOCUMENTATION
+const sourcemap = env.SOURCEMAP !== 'false'
const maxWorkers = Math.floor(availableParallelism() / 2)
const maxWorkers = Math.floor(availableParallelism() / 2)
@@
-36,21
+37,21
@@
export default defineConfig([
format: 'cjs',
...(isDevelopmentBuild && {
dir: './lib',
format: 'cjs',
...(isDevelopmentBuild && {
dir: './lib',
- sourcemap: true,
preserveModules: true,
preserveModulesRoot: './src'
}),
...(!isDevelopmentBuild && {
file: './lib/index.js',
preserveModules: true,
preserveModulesRoot: './src'
}),
...(!isDevelopmentBuild && {
file: './lib/index.js',
- sourcemap: true,
plugins: [terser({ maxWorkers })]
plugins: [terser({ maxWorkers })]
+ }),
+ ...(sourcemap && {
+ sourcemap
})
},
{
format: 'esm',
...(isDevelopmentBuild && {
dir: './lib',
})
},
{
format: 'esm',
...(isDevelopmentBuild && {
dir: './lib',
- sourcemap: true,
entryFileNames: '[name].mjs',
chunkFileNames: '[name]-[hash].mjs',
preserveModules: true,
entryFileNames: '[name].mjs',
chunkFileNames: '[name]-[hash].mjs',
preserveModules: true,
@@
-58,49
+59,39
@@
export default defineConfig([
}),
...(!isDevelopmentBuild && {
file: './lib/index.mjs',
}),
...(!isDevelopmentBuild && {
file: './lib/index.mjs',
- sourcemap: true,
plugins: [terser({ maxWorkers })]
plugins: [terser({ maxWorkers })]
+ }),
+ ...(sourcemap && {
+ sourcemap
})
}
],
})
}
],
- external: [
- 'node:async_hooks',
- 'node:cluster',
- 'node:crypto',
- 'node:events',
- 'node:fs',
- 'node:os',
- 'node:perf_hooks',
- 'node:worker_threads'
- ],
+ external: [/^node:*/],
plugins: [
typescript({
plugins: [
typescript({
- tsconfig: './tsconfig.build.json'
+ tsconfig: './tsconfig.build.json',
+ compilerOptions: {
+ sourceMap: sourcemap
+ }
}),
del({
targets: ['./lib/*']
}),
}),
del({
targets: ['./lib/*']
}),
-
isAnalyzeBuild
&& analyze(),
-
isDocumentationBuild
&& command('pnpm typedoc')
+
Boolean(isAnalyzeBuild)
&& analyze(),
+
Boolean(isDocumentationBuild)
&& command('pnpm typedoc')
]
},
{
input: './lib/dts/index.d.ts',
output: [{ format: 'esm', file: './lib/index.d.ts' }],
]
},
{
input: './lib/dts/index.d.ts',
output: [{ format: 'esm', file: './lib/index.d.ts' }],
- external: [
- 'node:async_hooks',
- 'node:cluster',
- 'node:events',
- 'node:perf_hooks',
- 'node:worker_threads'
- ],
+ external: [/^node:*/],
plugins: [
dts(),
del({
targets: ['./lib/dts'],
hook: 'buildEnd'
}),
plugins: [
dts(),
del({
targets: ['./lib/dts'],
hook: 'buildEnd'
}),
-
isAnalyzeBuild
&& analyze()
+
Boolean(isAnalyzeBuild)
&& analyze()
]
}
])
]
}
])