Pon task to compile file
$ npm install pon-task-compile --save'use strict'
const pon = require('pon')
const compile = require('pon-task-compile')
async function tryExample () {
let run = pon({
'compile:foo': compile('src/foo.txt', 'dest/bar.txt', (src, dest) => {
let compiled = '...'
let map = '...'
return [ compiled, map ]
})
})
run('compile:foo')
}
tryExample()Define compile task by pattern
| Param | type | Description |
|---|---|---|
| srcDir | string | Source directory name |
| destDir | string | Destination directory name |
| compiler | function | Compiler function |
| options | Object | Optional settings |
| options.pattern | string|string[] | File name pattern |
| options.watchDelay | number | Delay after watch |
| options.watchTargets | string[] | Additional watch target filenames |
| options.namer | function | Filename convert function |
Define task
| Param | type | Description |
|---|---|---|
| src | string | Source filename |
| dest | string | Destination filename |
| compiler | function | Compiler function |
| options | Object | Optional settings |
This software is released under the Apache-2.0 License.