2.0.1 • Published 9 years ago
compile-es6 v2.0.1
Alert
Now we have a better npm package: compile-esx and compile-esx-sync
The compile-es6 will not be maintained...
What
compile-es6 can compile es6 code in src folder to es5 code in target folder.
Example
const compileEs6 = require('compile-es6');
compileEs6(path.join(__dirname, 'src'), path.join(__dirname, 'target'));How
const compileEs6 = require('compile-es6');
compileEs6(srcFileOrFolderPath, targetFolderPath[, config]);srcFileOrFolderPath- necessary: true
- type: string
- content: absolute file or folder path
targetFolderPath- necessary: true
- type: string
- content: absolute folder path
confignecessary: false
type: object
includeLike webpack,
compile-es6will only compile files matchinginclude.- necessary: false
- type: regular expression
- default:
/\.js$/
excludeLike webpack,
compile-es6will not compile files matchingexclude.- necessary: false
- type: regular expression
- default: null
presetsfor babel preset config.
- necessary: false
- type: array
- default:
['es2015']