1.0.3 • Published 10 years ago
trucks-transform-bundle v1.0.3
Bundle Transform
Bundle files into the output templates, styles and scripts
Install
npm i trucks-transform-bundle --save-devFor the command line interface see trucks-cli.
Usage
Use the bundle key to configure this transform:
const trucks = require('trucks');
trucks(
{
files: ['components.html'],
transforms: ['bundle'],
conf: {
transforms: {
bundle: {
css: ['styles.css'],
js: ['app.js']
}
}
}
}, (err, res) => {
if(err) {
throw err;
}
console.log(res);
}
);API
bundle
public bundle(state, conf)Add input files to the output templates, styles and scripts.
The default behaviour will prepend input files.
Use the css, html and js lists to prepend files to the
corresponding output file. You may also use a more explicit notation
with the before and after options to control whether bundled
files are appended or prepended.
Returns map of visitor functions.
stateObject compiler state.confObject transform plugin configuration.
Options
beforeObject map of files to prepend.afterObject map of files to append.cssArray files to bundle with the stylesheet.htmlArray files to bundle with the templates.jsArray files to bundle with the javascript.
License
MIT
Created by mkdoc on July 28, 2016