@canlooks/compiler
v0.0.11
Published
Compile tools for canlooks
Downloads
16
Readme
@canlooks/compiler
This is a compile tools for canlooks
Installation
npm i @canlooks/compiler
Command Line
Usage: canlooks-compiler [action] [module] [options]
Arguments:
action Available actions: "clean", "core", or specify directory of the module
Options:
-v, --version output the version number
-c, --config <config> Configuration file name (default: "canlooks.config.json")
-d, --dir <dir> Directory name of compiled files (default: "dist")
-h, --help display help for command
API Example
import compiler from '@canlooks/compiler'
// compile core and all modules
compiler()
// clean compiled files
compiler('clean')
// compile core
compiler('core')
// compile module
compiler('myModuleName')
Configuration
The properties of canlooks.config.json
are as follows:
| name | type | default | description |
| -------- | -------- | --------------------------------------- | ---------------------------------------------------------------------------------- |
| public | string | "public" | This directory will copy to "dir" folder as is. |
| dir | string | "dist" | Name of the directory where the compiled file is stored |
| includes | string[] | "*/tsconfig.json" | Default rule: Folders whose contain the tsconfig.json
file are treated as module |
| excludes | string[] | ["node_modules", "src", "test", "dist"] | |
| modules | string[] | undefined | Using specified module only, includes and excludes are ignored |
canlooks.config.js
// object
module.exports = {
public: 'public',
dir: 'dist',
includes: ['*/tsconfig.json'],
excludes: ['node_modules', 'src', 'test', 'dist'],
modules: [],
}
// function
module.exports = () => {
return {
public: 'public',
dir: 'dist',
includes: ['*/tsconfig.json'],
excludes: ['node_modules', 'src', 'test', 'dist'],
modules: [],
}
}