2.0.1 • Published 3 years ago

think-babel v2.0.1

Weekly downloads
132
License
ISC
Repository
github
Last release
3 years ago

think-babel

Build Status Coverage Status npm

think-babel transpile ES6+ file to ES5

Syntax

import thinkBabel from 'think-babel';
thinkBabel({
  srcPath,
  outPath,
  file,
  options,
  ext,
});
  • srcPath {String} the file source path.
  • outPath {String} the directory for output file.
  • file {String} the file path in the 'srcPath'.
  • [options] {Object} the babel options,default
    {
      filename: file, 
      sourceFileName: path.join(srcPath, file), 
      presets: ['es2015'],
      sourceMaps: true,
      babelrc: false
    }
  • [ext] {String} the new file extension,default .js.

Usage

Transform ES6+ file to ES5:

import thinkBabel from 'think-babel';

thinkBabel({
  srcPath: './test/src/a',
  outPath: './test/out',
  file: 'b/test.es'
});
2.0.1

3 years ago

2.0.0

5 years ago

1.0.6

6 years ago

1.1.0

7 years ago

1.0.5

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.0

7 years ago