Skip to content

Commit

Permalink
Use filename instead of allExtension when using preset-typescript in …
Browse files Browse the repository at this point in the history
…Node api
  • Loading branch information
tsangint committed Mar 3, 2019
1 parent 8ace1b7 commit c24caa9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
7 changes: 4 additions & 3 deletions docs/preset-typescript.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,12 @@ babel --presets @babel/preset-typescript script.ts

### Via Node API

Need a filename with ts or tsx suffix

```javascript
require("@babel/core").transform("code", {
presets: [
["@babel/preset-typescript", { allExtensions: true }]
]
presets: ["@babel/preset-typescript"],
filename: "example.ts"
});
```

Expand Down
7 changes: 4 additions & 3 deletions website/versioned_docs/version-7.0.0/preset-typescript.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,12 @@ babel --presets @babel/preset-typescript script.ts

### Via Node API

Need a filename with ts or tsx suffix

```javascript
require("@babel/core").transform("code", {
presets: [
["@babel/preset-typescript", { allExtensions: true }]
]
presets: ["@babel/preset-typescript"],
filename: "example.ts"
});
```

Expand Down

0 comments on commit c24caa9

Please sign in to comment.