1.0.15 • Published 7 years ago

compile-esx-sync v1.0.15

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

What

compile-esx-sync can compile es6(es7 .etc) code in src folder/file to es5 code in target folder/file in sync mode.

How

/**
 *  @param {string} srcFileOrFolderPath - src file or folder path; relative or absolute
 *  @param {string} targetFileOrFolderPath - target file or folder path; relative or absolute
 *  @param {Object} config - config, including: watch/include/exclude
 *  @param {boolean} config.watch - false by default; watch file changes: add/change/unlink/unlinkDir
 *  @param {RegExp} config.include - /\.js$/ by default; will only compile files whose path matched this
 *  @param {RegExp} config.exclude - null by default; will not compile files whose path matched this
 *  @param {Array} config.presets - ['es2015'] by default; for babel config
 *  @return undefined
 */
compileEsx(srcFileOrFolderPath, targetFileOrFolderPath[, config]);

Example

const compileEsxSync = require('compile-esx-sync');

compileEsxSync('./src', './target', {
    watch: true,
    include: /\.js/,
    exclude: /node\_modules/
});

When

When you don't want to write webpack.config.js when coding node modules, but the same time also want to write es6/7..., you can use compile-esx and open the watch config to compile es6/7... code to es5.

const compileEsxSync = require('compile-esx-sync');

compileEsxSync('./src', './dist', {
    watch: true
});
1.0.15

7 years ago

1.0.14

7 years ago

1.0.13

7 years ago

1.0.12

7 years ago

1.0.11

7 years ago

1.0.10

7 years ago

1.0.9

7 years ago

1.0.8

7 years ago

1.0.7

7 years ago

1.0.6

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.1

7 years ago

1.0.0

7 years ago