Skip to content

Commit dd694b6

Browse files
author
Benjamin E. Coe
authored
build: use ts-transform-default-export for index.d.ts (#304)
1 parent 4c76e1c commit dd694b6

File tree

3 files changed

+7
-13
lines changed

3 files changed

+7
-13
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
"compile": "tsc",
2525
"postcompile": "npm run build:cjs",
2626
"build:cjs": "rollup -c",
27-
"postbuild:cjs": "node scripts/replace-legacy-export.cjs",
2827
"prepare": "npm run compile"
2928
},
3029
"repository": {
@@ -65,6 +64,7 @@
6564
"serve": "^11.3.2",
6665
"standardx": "^5.0.0",
6766
"start-server-and-test": "^1.11.2",
67+
"ts-transform-default-export": "^1.0.2",
6868
"typescript": "^4.0.0"
6969
},
7070
"files": [

rollup.config.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import ts from '@wessberg/rollup-plugin-ts'
2+
import transformDefaultExport from 'ts-transform-default-export'
23

34
const output = {
45
format: 'cjs',
@@ -12,6 +13,10 @@ export default {
1213
input: './lib/index.ts',
1314
output,
1415
plugins: [
15-
ts({ /* options */ })
16+
ts({
17+
transformers: ({ program }) => ({
18+
afterDeclarations: transformDefaultExport(program)
19+
})
20+
})
1621
]
1722
}

scripts/replace-legacy-export.cjs

Lines changed: 0 additions & 11 deletions
This file was deleted.

0 commit comments

Comments
 (0)