5.0.0 • Published 4 years ago

pon-task-compile v5.0.0

Weekly downloads
547
License
Apache-2.0
Repository
github
Last release
4 years ago

pon-task-compile

Build Status npm Version JS Standard

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

ParamtypeDescription
srcDirstringSource directory name
destDirstringDestination directory name
compilerfunctionCompiler function
optionsObjectOptional settings
options.patternstring|string[]File name pattern
options.watchDelaynumberDelay after watch
options.watchTargetsstring[]Additional watch target filenames
options.namerfunctionFilename convert function

define(src, dest, compiler, options) -> function

Define task

ParamtypeDescription
srcstringSource filename
deststringDestination filename
compilerfunctionCompiler function
optionsObjectOptional settings

License

This software is released under the Apache-2.0 License.

Links

5.0.0

4 years ago

4.0.5

5 years ago

4.0.4

5 years ago

4.0.3

5 years ago

4.0.0

6 years ago

3.0.4

6 years ago

3.0.3

7 years ago

3.0.2

7 years ago

3.0.1

7 years ago

2.1.6

7 years ago

2.1.5

7 years ago

2.1.4

7 years ago

2.1.3

7 years ago

2.1.2

7 years ago

2.1.1

7 years ago

2.0.1

7 years ago