React compile task for pon
$ npm install pon-task-react --save
'use strict'
const pon = require('pon')
const react = require('pon-task-react')
async function tryExample () {
let run = pon({
// Compile js files under "ui" directory into "shim" directory
'shim:ui': react('ui', 'shim', {
pattern: [ '**/*.js', '**/*.jsx' ]
})
})
run('shim:*')
}
tryExample()
Define task
Param | type | Description |
---|---|---|
srcDir | string | Source directory name |
destDir | string | Destination directory name |
options | Object | Optional settings |
options.pattern | string|string[] | File name pattern |
options.presets | string[] | Babel preset names |
options.plugins | string[] | Babel plugin names |
options.watchTargets | string[] | Additional watch target filenames |
options.watchDelay | number | Delay after watch |
This software is released under the Apache-2.0 License.