How to use the types function from babel-core

Find comprehensive JavaScript babel-core.types code examples handpicked from public code repositorys.

58
59
60
61
62
63
64
65
66
67
```
此时,我们为插件创建一个文件,内容为导出一个默认的函数:
```js
// moriscript.js
module.exports = function(babel) {
  var t = babel.types;
  return {
    visitor: {
    }
  };
fork icon395
star icon47
watch icon2

+ 3 other calls in file

12
13
14
15
16
17
18
19
20
21

const babel = require('babel-core');
const invariant = require('fbjs/lib/invariant');

import type {Ast, SourceMap} from 'babel-core';
const t = babel.types;

const React = {name: 'React'};
const ReactNative = {name: 'ReactNative'};
const platform = {name: 'Platform'};
fork icon0
star icon2
watch icon18