firescript-builder
v0.3.0
Published
Firescript project builder module for Firescript
Downloads
22
Maintainers
Readme
Firescript builder
Firescript project builder module used by the firescript build
command.
Usage
import { FirescriptBuilder } from 'firescript-builder'
const builder = new FirescriptBuilder({
srcDir: `${process.cwd()}/src/`,
destDir: `${process.cwd()}/dist/`
})
const files = await builder.build()
console.log('Affected files:', files)
Methods
async build([str srcDir], [str destDir]) => arr affectedFiles
Build project, it parse, lint and transpiles all .fire files.
const files = await builder.build()
console.log('Affected files:', files)
Arguments:
| Name: | Flags: | Description: |
| --------- | ---------- | ------------------------- |
| scrDir | optional
| Overwrites this.srcDir
|
| destDir | optional
| Overwrites this.destDir
|
Returns:
Returns An array of affected files.
async copy(arr filePattern, [str srcDir], [str destDir]) => arr affectedFiles
Copies files who matching on of the filePattern from srcDir
to destDir
const filePattern = [
'package.json'
'README.md',
'templates/**/*.js'
]
const files = await builder.copy(filePattern)
console.log('Affected files:', files)
Arguments:
| Name: | Flags: | Description: |
| ------------- | ---------- | --------------------------------- |
| filePattern | required
| Defines an array of file patterns |
| scrDir | optional
| Overwrites this.srcDir
|
| destDir | optional
| Overwrites this.destDir
|
Returns:
Returns An array of affected files.