1.0.0 • Published 7 years ago

grunt-systemjs-builder v1.0.0

Weekly downloads
2,419
License
MIT
Repository
github
Last release
7 years ago

npm version

grunt-systemjs-builder

Getting started

To Install

npm install --save-dev grunt-systemjs-builder

To register for grunt:

grunt.loadNpmTasks("grunt-systemjs-builder");

To run with grunt use the following command:

grunt systemjs

This is a MultiTask therefore it can run using different configuration using targets in the grunt configuration. see grunt docs for more info.

Options

In essence, this grunt task simply passes along configuration to the SystemJS Builder. You should familiarize yourself with its configuration documentation.

baseURL: string

"The baseURL provides a special mechanism for loading modules relative to a standard reference URL."

systemjs docs

if baseURL is provided through the configuration, it will be the one used and any subsequent baseURL configuration (even) from a configFile will be ignored as systemjs only allows to configure baseURL once.

configFile: String

path to an external configuration file (one with System.config(...) calls).

sfx: Boolean

default: false

Create a self-executing bundle

minify: Boolean

default: false

shortcut for passing the build object with a minify property

sourceMaps: Boolean

default: true

shortcut for passing the build object with a sourceMapsproperty

builder: Object

The configuration that is allowed when creating the builder instance. Basically any valid systemjs configuration (same as calling System.config()). see builder documentation.

the configuration that is allowed when running build or buildSFX see builder documentation.

Files

Configuring the source and destination files is done in the standard grunt way using the "files" property of the target (see example below)

Example

grunt.initConfig({
	systemjs: {
	            options: {
	                sfx: true,
	                baseURL: "./target",
	                configFile: "./target/config.js",
                	minify: true,
					build: {
					  mangle: false
					}
	            },
	            dist: {
	                files: [{
	                    "src":  "./target/src/init.js",
	                    "dest": "./target/bundles/app.min.js"
	                }]
	            }
	        }
});

Change Log

1.0.0

  • upgraded dependency on systemjs-builder to allow 0.16.x installs
  • upgraded grunt dependency to 1.0.1
1.0.0

7 years ago

0.2.7

8 years ago

0.2.6

8 years ago

0.2.5

8 years ago

0.2.4

8 years ago

0.2.3

8 years ago

0.2.2

9 years ago

0.2.1

9 years ago

0.2.0

9 years ago

0.1.0

9 years ago