-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathsystemjs.node_cli.txt
77 lines (64 loc) · 5 KB
/
systemjs.node_cli.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
┏━━━━━━━━━━━━━━┓
┃ SYSTEMJS ┃
┗━━━━━━━━━━━━━━┛
VERSION ==> #0.18.2
#Do not forget to keep system-polyfill.js in the DIR
CSP ==> #Should use the system-csp-production.js when CSP is enabled.
System #from require("systemjs")
System.register #Like define(), but meant as a browser polyfill output from ES6 (e.g. with Babel)
(["MDL2", ]"MDL"_ARR, FUNC(MDL)) #Should use Babel to produce this.
System.registerDynamic(["MDL2",]
"MDL"_ARR, BOOL, FUNC(MDL)) #Same but for non-ES6 input. If BOOL true, only loads when require() called.
System.newModule(OBJ)->MDL #Like simple define(). Must be followed by System.set("MDL", MDL)
System.import(URL|PATH) #Like require(), but works with:
->MDL_PROMISE # - AMD:
# - including the CommonJS-form require(...), or using "require" MDL
# - must define WINDOW.define|require = System.amdDefine|amdRequire
# - ES6:
# - uses CONFOBJ.transpiler "traceur|babel|typescript"
# - can specify CONFOBJ.traceur|babel|typescriptOptions OBJ
# - CommonJS:
# - patches require(), but can recover with System._nodeRequire()
# - Global: for file GLOB, can use PLUGIN_CONF:
# - format "global"
# - exports "VAR" (def: anything assigned to global object, or as top-level
# var VAR = VAL, during the loading of GLOB)
# - deps MDL_ARR
# - globals.VAR "MDL" to assign GLOBAL.VAR = "MDL"_VAL but only while GLOB is loading
#Automatically detected but can use CONFOBJ.format "cjs|amd|es6|global"
System.get("MDL")->MDL #Same but must have used System.import() before
System.has("MDL") #Has System.import() been called before
System.delete("MDL") #
System.config(CONFOBJ) #CONFOBJ:
# - baseURL DIR (Def: "/"): applied to relative paths not using "./" or "../"
# - map { MDL: PATH } (like RequireJS). Applied before baseURL
# - paths: same but after baseURL and globbing. Prefer map.
# - bundles.MDL "MDL2"_ARR: make "MDL" load "MDL2"_ARR
# - meta.GLOB PLUGIN_CONF
# - depCache.MDL "MDL2_ARR": other way to specify dependencies. They will not
# be loaded until required, and will be bundled in separate files.
# - packages.PATH CONFOBJ: specific CONFOBJ for anything under that path
new SYSTEMJS-BUILDER([CONFOBJ]) #Node module (0.12.0). Builds ES6 to single SystemJS file.
->BUILDER #CONFOBJ also includes:
# - minify BOOL, mangle BOOL (def: true), globalDefs.VAR false
# - sourceMaps BOOL
#Can ignore some files with PLUGIN_CONF.build false
BUILDER.loadConfig(PATH)->PROMISE #JavaScript file exporting CONFOBJ
BUILDER.config(CONFOBJ) #
BUILDER.build(["MDL,"]INPUT_PATH #If no OUTPUT_PATH, PROMISE gets OBJ as value: source, sourceMap, modules "MDL"_ARR
[, OUTPUT_PATH])->PROMISE #INPUT_PATH can:
# - include globbing (including **)
# - end with " - GLOB2", to exclude files
BILDR.buildSFX(["MDL,"]INPUT_PATH,#So output can be loaded in a <script> without SystemJS loader.
[OUTPUT_PATH[, OBJ]])->PROMISE #If OBJ.runtime true (def), include Babel|Traceur runtime if needed
#Can also output according to OBJ.sfxFormat "cjs|amd|es6"
System.bundles.PATH = "MDL"_ARR #Put those MDL in a separate file. Will be loaded dynamically.
PLUGINS ==> #Must use PLUGIN_CONF.loader "MDL", or "MDL2!MDL" syntax
#Makes imports/require() do some processing (like Browserify transform or RequireJS filter)
"MDL!text" #Returns as STR (plugin-text 13/02/2015)
"MDL.json" #Returns as OBJ (plugin-json 17/04/2015)
"MDL!image" #Prefetches (plugin-image 28/01/2015)
"MDL.coffee!" #(0.1.2)
"MDL.jade!" #(0.4.0)
"MDL.md!" #
"MDL.hbs!" #Precompiled template