Skip to content

Commit 5522198

Browse files
committed
build: Clean up rollup config
1 parent e5ad23f commit 5522198

File tree

1 file changed

+10
-18
lines changed

1 file changed

+10
-18
lines changed

rollup.demos.js

+10-18
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
// @ts-check
21
/*
32
* This config only bundles the demos. The library itself is published unbundled.
43
*/
4+
// @ts-check
55
import path from 'node:path'
66
import { defineConfig } from 'rollup'
77
import { nodeExternals } from 'rollup-plugin-node-externals'
@@ -12,9 +12,9 @@ import { koffi } from 'libwin32/rollup-plugin'
1212

1313
// Use distinct configs to prevent Rollup from code-splitting the library.
1414
export default [
15-
// config('window'),
15+
makeConfig('window'),
1616
makeConfig('messagebox'),
17-
// config('enumdesktopwindows'),
17+
makeConfig('enumdesktopwindows'),
1818
]
1919

2020
/** @param { string } which */
@@ -32,25 +32,17 @@ function makeConfig(which) {
3232
assetFileNames: 'assets/[name].[ext]',
3333
sourcemap: true
3434
},
35-
/* treeshake: {
36-
manualPureFunctions: [
37-
'koffi.alias', 'koffi.pointer', 'koffi.opaque', 'koffi.struct', 'koffi.proto',
38-
'kernel32.lib.func', 'user32.lib.func',
39-
'koffi.out', 'koffi.inout',
40-
]
41-
}, */
4235
plugins: [
43-
nodeExternals(),
36+
nodeExternals({ include: 'tslib' }),
4437
nodeResolve(),
4538
commonjs(),
4639
typescript({
47-
include: [ 'source/demos' ],
48-
compilerOptions: {
49-
outDir,
50-
declaration: false,
51-
declarationMap: false,
52-
preserveConstEnums: false
53-
}
40+
outDir,
41+
importHelpers: true,
42+
declaration: false,
43+
declarationMap: false,
44+
preserveConstEnums: false,
45+
target: 'es2023'
5446
}),
5547
koffi()
5648
]

0 commit comments

Comments
 (0)