Skip to content

tolerious/generator-babel-plugin

Repository files navigation

generator-babel-plugin

Node.js Package npm 总下载量

使用Yeoman来创建babel plugin. 代码fork自generator-babel-plugin, 原仓库经过测试,在本地无法运行了,故此fork了项目进行了修改。

用法

全局安装Yeoman

npm i -g yo
npm i -g generator-babel-plugins

创建插件文件夹

mkdir my-babel-plugin && cd my-babel-plugin

运行generator

yo babel-plugins

如果你想在测试中创建额外的fixtures

yo babel-plugins:fixture name-of-fixture

为了更好的理解Babel插件的开发,强烈建议阅读babel plugin handbook

同时我也提供了中文翻译改进版,针对原版中的排版问题以及过时的描述予以更正。

为了测试插件,可以配合另外一个项目simple-babel-project-template进行使用,创建好babel插件后,为了在本地进行效果测试,可以在新创建的插件项目中运行

npx link

然后在使用simple-babel-project-template的项目中运行

npm link your-babel-plugin

其中your-babel-plugin就是你创建插件的那个项目中package.json文件中name字段.

License

MIT

About

Another version for the original generator-babel-plugin

Topics

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors