funcunit
Version:
<!-- @hide title
47 lines (28 loc) • 1.54 kB
Markdown
[](https://travis-ci.org/stealjs/steal-bundler)
[](http://badge.fury.io/js/steal-bundler)
For StealTools projects, steal-bundler provides an easy way to bundle static assets along with your CSS and JavaScript, so that your dist folder can be sent to a CDN.
steal-bundler infers static assets from your project and copies them for you automatically (can be turned off if undesired).
## Use
```js
var stealTools = require("steal-tools");
var bundleAssets = require("steal-bundler");
stealTools.build){
config: __dirname + "/package.json!npm"
}).then(function(buildResult){
bundleAssets(buildResult, {
glob: "images/**/*"
});
});
```
Calling `require("steal-bundler")` will return a function that when called will bundle assets and pack them into a destination folder.
The [BuildResult](http://stealjs.com/docs/steal-tools.BuildResult.html) obtained from calling `stealTools.build`.
An optional object for specifying additional options. They are:
- __infer__: By default steal-bundler will infer your static assets in your project by reading your CSS and JavaScript. Set this to `false` if you want to manually specify static assets.
- __glob__: A string or array of strings, of [minimatch globs](https://github.com/isaacs/minimatch) specifying files to be copied.
MIT