Skip to content

Commit a4cdf9e

Browse files
committed
Generate single declaration file for umd build
1 parent 1666f7b commit a4cdf9e

File tree

2 files changed

+146
-2
lines changed

2 files changed

+146
-2
lines changed

package-lock.json

Lines changed: 142 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"watch": "npm-run-all --parallel watch:js watch:css",
1717
"watch:js": "tsc -p tsconfig.esm.json --watch",
1818
"watch:css": "sass -w src:lib",
19-
"build:umd": "webpack --mode=production",
19+
"build:umd": "webpack --mode=production && npm run generate:dts-bundle",
2020
"build:cjs": "tsc -p tsconfig.cjs.json",
2121
"build:esm": "tsc -p tsconfig.esm.json",
2222
"clean:css": "cleancss lib/index.css -o lib/index.css -O 2",
@@ -30,7 +30,8 @@
3030
"build:all": "npm run build && npm run build:docs",
3131
"deploy:docs": "gh-pages -d docs/public",
3232
"version": "npm run build:all && git add *",
33-
"postversion": "git push && git push --tags && npm publish && npm run deploy:docs"
33+
"postversion": "git push && git push --tags && npm publish && npm run deploy:docs",
34+
"generate:dts-bundle": "dts-bundle-generator --no-check --umd-module-name CUI -o lib/cui.d.ts src/index.ts"
3435
},
3536
"peerDependencies": {
3637
"mithril": ">=2.0.4"
@@ -64,6 +65,7 @@
6465
"copy-webpack-plugin": "^11.0.0",
6566
"cross-env": "^7.0.3",
6667
"css-loader": "^6.7.1",
68+
"dts-bundle-generator": "^6.13.0",
6769
"eslint": "^8.18.0",
6870
"file-loader": "^6.2.0",
6971
"fork-ts-checker-webpack-plugin": "^7.2.11",

0 commit comments

Comments
 (0)