1.0.5 • Published 10 years ago
trucks-transform-copy v1.0.5
Copy Transform
Copy files into the output directory
Install
npm i trucks-transform-copy --save-devUsage
Use the copy key to configure this transform:
const trucks = require('trucks');
trucks(
{
files: ['components.html'],
transforms: ['copy'],
copy: {
files: {
'src/index.html': 'index.html'
}
}
}, (err, res) => {
if(err) {
throw err;
}
console.log(res);
}
);API
copy
public copy(state, conf)Copy input files to the output directory.
Files are defined using an input mapping:
{
copy: {
files: {
'src/index.html': 'index.html'
}
}
}Input files are the keys and are resolved relative to the base option.
The values are output paths relative to the compiler output directory.
Returns map of visitor functions.
stateObject compiler state.confObject transform plugin configuration.
Options
filesObject map of files to copy.baseString base path for relative input files.
License
MIT
Created by mkdoc on August 2, 2016