pon-task-compile
v5.0.0
Published
Pon task to compile file
Downloads
41
Readme
pon-task-compile
Pon task to compile file
Installation
$ npm install pon-task-compile --save
Usage
'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()
Signatures
byPattern(srcDir, destDir, compiler, options)
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(src, dest, compiler, options) -> function
Define task
| Param | type | Description | | ---- | --- | ----------- | | src | string | Source filename | | dest | string | Destination filename | | compiler | function | Compiler function | | options | Object | Optional settings |
License
This software is released under the Apache-2.0 License.