A systemJS build tool to create plugin based bundles.
This project allows builds of systemjs based modules. The key feature is separated build outputs. The main build, called base build, should contain all required modules and libraries. You then have the option to add smaller builds, called plugins, containing modules missing in the base build. This approach allows to ship builds on websites, where the base script is cached by the browser while plugins can be exchanged on each site and keep traffic low.
This package is available on npm
npm install systemjs-pluginbuilder
This defines the builder which should be used. There are currently two possible
jspm. Each value refers to a specific builder:
The default value of this option is
Attention: When using
jspm as builder, the
configPath option will
be ignored. The builder uses the configured path to the config file inside the
package.json. You also should not rewrite the
baseURL property using
config option. This value can be defined in the
This sets the path to the systemjs config file. This is option is required when
This option allows to add or overwrite settings from the loaded config file.
This is the path to the base file. The path should be defined as
This option is required.
This is a list of all plugin files. The build of these files will have a
substracted module tree of the base file. The paths will be defined as
array of strings.
This defines the relative output path for built base and plugin files. The
path is defined relative to each source file (defined by
pluginPaths). The default value is
Example: When using
out option, with
js/src/Base.js being the location of the base file, the build process
will output to
An instance of the PluginBuilder has the following methods
The constructor will create an instance of the pluginbuilder. You can pass the options as properties of an object into the constructor. The available options are documented here.
var PluginBuilder =var builder =basePath: 'jsr/src/Base.js'pluginPaths:'js/src/PluginA.js''js/src/PluginB.js';
When calling this function, a build will be generated with the given options from the constructor. This function returns a promise to handle the async build process.
An example is located in the example directory. Simply clone this
npm install and run
node example/example.js. This
example will create a build directory in
Feel free to contribute. Please run all the tests and validation tasks before you offer a pull request.
grunt validate test to run the tests and validation tasks.
The readme chapters are located in the docs directory as Markdown. All
Markdown files will be concatenated through a grunt task
grunt docs to only update the
grunt to run
validation, tests and update the ```README.md``.
Note: Do not edit the README.md directly, it will be overwritten!