Note, this guide assumes you have been through the progressive loading guide, or have an existing StealJS project set up.
Development bundles enable faster reload times during development by bundling together dependencies in the node_modules/ folder. There are two kinds of development bundles, enabled by the following attributes in the Steal script tag:
dev-bundle: A bundle that contains all of your node_modules dependencies, and the configuration contained within your package.json. Use this bundle type if you want the fastest page load times.
deps-bundle: A bundle that contains all of your node_modules dependencies. Unlike the dev_bundle, this does not contain your package.json configuration. Use this bundle type if you plan on changing configuration often or are installing new npm dependencies.
API
The API for development bundles is split between parts in steal-tools, where the bundles are created, and steal, where you configuration the loader to load the bundles.
steal
depsBundle: Specifies that a deps bundle should be preloaded before the main.
devBundle: Specifies that a dev bundle should be preloaded before the main.
Note that these config values should almost always be specified in the steal script tag:
This should create a file dev-bundle.js at the root folder of your project. If StealJS is also loading your CSS files there should be a dev-bundle.css file, too.
It is possible to provide an alternative destination folder using the --dest
option, run steal-tools bundle --help to see all the options available.
Development bundles enable faster reload times during development by bundling together dependencies in the
node_modules/
folder. There are two kinds of development bundles, enabled by the following attributes in the Steal script tag:API
The API for development bundles is split between parts in steal-tools, where the bundles are created, and steal, where you configuration the loader to load the bundles.
steal
Note that these config values should almost always be specified in the steal script tag:
steal-tools
Creating dev and deps bundles can be done either through the
steal-tools bundle
command, or throughstealTools.bundle()
when using the JavaScript API.steal-tools bundle: A cli command that allows you to create a dev/deps bundle by passing a flag.
bundle: A JavaScript API that allows building configurable bundles. To create a dev bundle use the
filter
with these values:Enabling Development Bundles
Edit your package.json and add a new npm script like the following:
Save the changes and run the
deps-bundle
script:This should create a file
dev-bundle.js
at the root folder of your project. If StealJS is also loading your CSS files there should be adev-bundle.css
file, too.