1
- // @ts -check
2
1
/*
3
2
* This config only bundles the demos. The library itself is published unbundled.
4
3
*/
4
+ // @ts -check
5
5
import path from 'node:path'
6
6
import { defineConfig } from 'rollup'
7
7
import { nodeExternals } from 'rollup-plugin-node-externals'
@@ -12,9 +12,9 @@ import { koffi } from 'libwin32/rollup-plugin'
12
12
13
13
// Use distinct configs to prevent Rollup from code-splitting the library.
14
14
export default [
15
- // config ('window'),
15
+ makeConfig ( 'window' ) ,
16
16
makeConfig ( 'messagebox' ) ,
17
- // config ('enumdesktopwindows'),
17
+ makeConfig ( 'enumdesktopwindows' ) ,
18
18
]
19
19
20
20
/** @param { string } which */
@@ -32,25 +32,17 @@ function makeConfig(which) {
32
32
assetFileNames : 'assets/[name].[ext]' ,
33
33
sourcemap : true
34
34
} ,
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
- }, */
42
35
plugins : [
43
- nodeExternals ( ) ,
36
+ nodeExternals ( { include : 'tslib' } ) ,
44
37
nodeResolve ( ) ,
45
38
commonjs ( ) ,
46
39
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'
54
46
} ) ,
55
47
koffi ( )
56
48
]
0 commit comments