src2dist
v0.2.1
Published
Output the template source file to the destination by default variables.
Downloads
2
Readme
src2dist
Output the template source file to the destination by default variables
Feature
- can be renamed
- can be excluded
Install
npm i src2dist -D
Usage
import src2dist from 'src2dist'
// const src2dist = require("src2dist").default;
src2dist(
sourcePath:String,
distPath:String,
variables?={}:Object,
options?={}:Option
) => success:bool
interface Option {
exclude?=defaultRenderExclude:Array[String|Regular]
cover?=false:Boolean
}
const defaultRenderExclude = [
'.*eot$',
'.*svg$',
'.*ttf$',
'.*woff$',
'.*jpe?g$',
'.*png$',
'.*gif$',
];
src2dist(
`${__dirname}/source`,
`${__dirname}/source-dist`,
{
name: 'n1',
},
{
exclude: ['.*\.js'],
}
);
Note
- item of
options.exclude
is the relative path of the children file tosourcePath
License
MIT