Code Monkey home page Code Monkey logo

babel-d's Introduction

babel-d

在 node 端使用 babel 运行编译某个文件夹下所有js文件到某个指定文件夹。

背景

在使用 babelCompile Directories 时,可以使用 --out-dir 或者 -d 参数。

例如,我们要编译 src 文件夹下所有的js文件,并输出到 lib 文件夹下,则可以执行:

babel src --out-dir lib

# 或者

babel src -d lib

这是通过 babel-cli 来运行的。如果需要在 node 端调用编译某个文件,可以安装 babel-core,并使用其提供的 babel.transformapi。但是这种方式如果处理某个文件夹下所有的文件的编译,则十分不方便,因此本项目就是为了解决这种场景。

参考

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.