feat(ref-transform): auto infer parser plugins

This commit is contained in:
Evan You
2021-08-23 12:20:53 -04:00
parent 0805abe573
commit 6453359852
3 changed files with 19 additions and 4 deletions

View File

@@ -60,7 +60,11 @@ const {
} = transform(src, {
filename: 'foo.ts',
sourceMap: true,
parserPlugins: ['typescript']
// @babel/parser plugins to enable.
// 'typescript' and 'jsx' will be auto-inferred from filename if provided,
// so in most cases explicit parserPlugins are not necessary
parserPlugins: [/* ... */]
})
```