repositories
/
poolifier.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'master' of github.com:poolifier/poolifier
[poolifier.git]
/
rollup.config.mjs
diff --git
a/rollup.config.mjs
b/rollup.config.mjs
index aac1c8cdd00740db11a5c031b31b14c850049c17..e3af7e1d8af9657fe50be3750b7aa4acd8671a25 100644
(file)
--- a/
rollup.config.mjs
+++ b/
rollup.config.mjs
@@
-1,4
+1,5
@@
import * as os from 'node:os'
import * as os from 'node:os'
+import { env } from 'node:process'
import { dts } from 'rollup-plugin-dts'
import terser from '@rollup/plugin-terser'
import typescript from '@rollup/plugin-typescript'
import { dts } from 'rollup-plugin-dts'
import terser from '@rollup/plugin-terser'
import typescript from '@rollup/plugin-typescript'
@@
-20,9
+21,9
@@
const availableParallelism = () => {
return availableParallelism
}
return availableParallelism
}
-const isDevelopmentBuild =
process.
env.BUILD === 'development'
-const isAnalyzeBuild =
process.
env.ANALYZE
-const isDocumentationBuild =
process.
env.DOCUMENTATION
+const isDevelopmentBuild = env.BUILD === 'development'
+const isAnalyzeBuild = env.ANALYZE
+const isDocumentationBuild = env.DOCUMENTATION
const maxWorkers = Math.floor(availableParallelism() / 2)
const maxWorkers = Math.floor(availableParallelism() / 2)
@@
-33,23
+34,22
@@
export default defineConfig([
output: [
{
format: 'cjs',
output: [
{
format: 'cjs',
+ sourcemap: true,
...(isDevelopmentBuild && {
dir: './lib',
...(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 })]
})
},
{
format: 'esm',
plugins: [terser({ maxWorkers })]
})
},
{
format: 'esm',
+ sourcemap: true,
...(isDevelopmentBuild && {
dir: './lib',
...(isDevelopmentBuild && {
dir: './lib',
- sourcemap: true,
entryFileNames: '[name].mjs',
chunkFileNames: '[name]-[hash].mjs',
preserveModules: true,
entryFileNames: '[name].mjs',
chunkFileNames: '[name]-[hash].mjs',
preserveModules: true,
@@
-57,49
+57,36
@@
export default defineConfig([
}),
...(!isDevelopmentBuild && {
file: './lib/index.mjs',
}),
...(!isDevelopmentBuild && {
file: './lib/index.mjs',
- sourcemap: true,
plugins: [terser({ maxWorkers })]
})
}
],
plugins: [terser({ maxWorkers })]
})
}
],
- 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: true
+ }
}),
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()
]
}
])
]
}
])