compile-es6
v2.0.1
Published
compile es6 code in folders/files
Downloads
640
Readme
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
config
necessary: false
type: object
include
Like webpack,
compile-es6
will only compile files matchinginclude
.- necessary: false
- type: regular expression
- default:
/\.js$/
exclude
Like webpack,
compile-es6
will not compile files matchingexclude
.- necessary: false
- type: regular expression
- default: null
presets
for babel preset config.
- necessary: false
- type: array
- default:
['es2015']