Skip to content

Commit 4a4becc

Browse files
Transpile TypeScript syntax
Support .ts files in the Babel build.
1 parent 11e6f23 commit 4a4becc

File tree

3 files changed

+24
-2
lines changed

3 files changed

+24
-2
lines changed

.babelrc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"presets": [
3-
"@babel/env"
3+
"@babel/env",
4+
"@babel/preset-typescript"
45
]
56
}

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"lib": "lib"
1010
},
1111
"scripts": {
12-
"build": "npm run clean && babel src -d lib",
12+
"build": "npm run clean && babel src -d lib --extensions '.js,.ts'",
1313
"clean": "rimraf lib/*",
1414
"test": "echo \"Error: no test specified\" && exit 1"
1515
},
@@ -18,6 +18,7 @@
1818
"@babel/cli": "^7.0.0-beta.54",
1919
"@babel/core": "^7.0.0-beta.54",
2020
"@babel/preset-env": "^7.0.0-beta.54",
21+
"@babel/preset-typescript": "^7.0.0-beta.54",
2122
"rimraf": "^2.6.2"
2223
}
2324
}

yarn.lock

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,12 @@
259259
dependencies:
260260
"@babel/helper-plugin-utils" "7.0.0-beta.54"
261261

262+
"@babel/plugin-syntax-typescript@7.0.0-beta.54":
263+
version "7.0.0-beta.54"
264+
resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.0.0-beta.54.tgz#7b01ddebccba8f78693bf2898e1f695bb8a76a7e"
265+
dependencies:
266+
"@babel/helper-plugin-utils" "7.0.0-beta.54"
267+
262268
"@babel/plugin-transform-arrow-functions@7.0.0-beta.54":
263269
version "7.0.0-beta.54"
264270
resolved "https://registry.yarnpkg.com/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.0.0-beta.54.tgz#44a977b8e61e4efcc7658bbbe260f204ca1bcf72"
@@ -439,6 +445,13 @@
439445
dependencies:
440446
"@babel/helper-plugin-utils" "7.0.0-beta.54"
441447

448+
"@babel/plugin-transform-typescript@7.0.0-beta.54":
449+
version "7.0.0-beta.54"
450+
resolved "https://registry.yarnpkg.com/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.0.0-beta.54.tgz#7b614ba0dbea88b70ae82df9c429e128928c9251"
451+
dependencies:
452+
"@babel/helper-plugin-utils" "7.0.0-beta.54"
453+
"@babel/plugin-syntax-typescript" "7.0.0-beta.54"
454+
442455
"@babel/plugin-transform-unicode-regex@7.0.0-beta.54":
443456
version "7.0.0-beta.54"
444457
resolved "https://registry.yarnpkg.com/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.0.0-beta.54.tgz#1dc7e9150b39aaeb19fca1c863e082f6096afc60"
@@ -492,6 +505,13 @@
492505
js-levenshtein "^1.1.3"
493506
semver "^5.3.0"
494507

508+
"@babel/preset-typescript@^7.0.0-beta.54":
509+
version "7.0.0-beta.54"
510+
resolved "https://registry.yarnpkg.com/@babel/preset-typescript/-/preset-typescript-7.0.0-beta.54.tgz#7491df7c0f20d08ca63c41f78d2c722c92470391"
511+
dependencies:
512+
"@babel/helper-plugin-utils" "7.0.0-beta.54"
513+
"@babel/plugin-transform-typescript" "7.0.0-beta.54"
514+
495515
"@babel/template@7.0.0-beta.54":
496516
version "7.0.0-beta.54"
497517
resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.0.0-beta.54.tgz#d5b0d2d2d55c0e78b048c61a058f36cfd7d91af3"

0 commit comments

Comments
 (0)