Skip to content

Commit a81d2d7

Browse files
Build: Add scripts to compile typescript before publishing to npm
1 parent ee05628 commit a81d2d7

File tree

5 files changed

+12
-0
lines changed

5 files changed

+12
-0
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,3 +59,6 @@ typings/
5959

6060
# next.js build output
6161
.next
62+
63+
lib
64+
types

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ install:
1111

1212
script:
1313
- npm run lint
14+
- npm run build
1415

1516
after_success:
1617
- npx semantic-release

package.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
"description": "Convert HTML DOM to React elements",
55
"main": "./lib/index.js",
66
"scripts": {
7+
"build": "npm run clean && tsc --project .",
8+
"clean": "rimraf lib/ types/ yarn-error.log npm-debug.log",
79
"commitmsg": "commitlint -E GIT_PARAMS",
810
"lint": "tslint --project .",
911
"lint:fix": "tslint --fix --project ."
@@ -18,12 +20,17 @@
1820
"url": "https://github.com/thomasthiebaud/htmldom-to-react/issues"
1921
},
2022
"homepage": "https://github.com/thomasthiebaud/htmldom-to-react#readme",
23+
"files": [
24+
"lib",
25+
"types"
26+
],
2127
"devDependencies": {
2228
"@semantic-release/changelog": "2.1.1",
2329
"@semantic-release/git": "6.0.1",
2430
"commitlint": "7.0.0",
2531
"conventional-changelog-eslint": "3.0.0",
2632
"husky": "0.14.3",
33+
"rimraf": "2.6.2",
2734
"semantic-release": "15.6.3",
2835
"tslint": "5.10.0",
2936
"tslint-react": "3.6.0",

src/index.ts

Whitespace-only changes.

tsconfig.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
"outDir": "lib",
1111
"sourceMap": true,
1212
"target": "es6",
13+
"declarationDir": "types"
1314
},
1415
"include": [
1516
"./src/**/*"

0 commit comments

Comments
 (0)