jspm 0.16.51 → 0.16.55
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/docs/getting-started.md +1 -1
- package/docs/production-workflows.md +3 -2
- package/lib/core.js +1 -1
- package/package.json +4 -4
- package/docs/_book/api.html +0 -449
- package/docs/_book/getting-started.html +0 -425
- package/docs/_book/gitbook/app.js +0 -25001
- package/docs/_book/gitbook/fonts/fontawesome/FontAwesome.otf +0 -0
- package/docs/_book/gitbook/fonts/fontawesome/fontawesome-webfont.eot +0 -0
- package/docs/_book/gitbook/fonts/fontawesome/fontawesome-webfont.svg +0 -504
- package/docs/_book/gitbook/fonts/fontawesome/fontawesome-webfont.ttf +0 -0
- package/docs/_book/gitbook/fonts/fontawesome/fontawesome-webfont.woff +0 -0
- package/docs/_book/gitbook/images/apple-touch-icon-precomposed-152.png +0 -0
- package/docs/_book/gitbook/images/favicon.ico +0 -0
- package/docs/_book/gitbook/plugins/gitbook-plugin-fontsettings/buttons.js +0 -151
- package/docs/_book/gitbook/plugins/gitbook-plugin-fontsettings/website.css +0 -291
- package/docs/_book/gitbook/plugins/gitbook-plugin-ga/plugin.js +0 -17
- package/docs/_book/gitbook/plugins/gitbook-plugin-highlight/ebook.css +0 -131
- package/docs/_book/gitbook/plugins/gitbook-plugin-highlight/website.css +0 -426
- package/docs/_book/gitbook/plugins/gitbook-plugin-search/lunr.min.js +0 -7
- package/docs/_book/gitbook/plugins/gitbook-plugin-search/search.css +0 -27
- package/docs/_book/gitbook/plugins/gitbook-plugin-search/search.js +0 -135
- package/docs/_book/gitbook/plugins/gitbook-plugin-sharing/buttons.js +0 -93
- package/docs/_book/gitbook/style.css +0 -9
- package/docs/_book/index.html +0 -344
- package/docs/_book/installing-packages.html +0 -448
- package/docs/_book/linking.html +0 -367
- package/docs/_book/nodejs-usage.html +0 -352
- package/docs/_book/plugins.html +0 -379
- package/docs/_book/production-workflows.html +0 -391
- package/docs/_book/publishing-packages.html +0 -425
- package/docs/_book/registries.html +0 -403
- package/docs/_book/registry-api.html +0 -423
- package/docs/_book/registry-property.html +0 -344
- package/docs/_book/search_index.json +0 -1
- package/docs/book.json +0 -8
- package/docs/node_modules/gitbook-plugin-ga/.npmignore +0 -25
- package/docs/node_modules/gitbook-plugin-ga/LICENSE +0 -201
- package/docs/node_modules/gitbook-plugin-ga/README.md +0 -48
- package/docs/node_modules/gitbook-plugin-ga/book/plugin.js +0 -17
- package/docs/node_modules/gitbook-plugin-ga/index.js +0 -8
- package/docs/node_modules/gitbook-plugin-ga/package.json +0 -63
package/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
jspm CLI
|
|
2
2
|
===
|
|
3
3
|
|
|
4
|
-
[![NPM version][npm-image]][npm-url] [![Downloads][downloads-image]][npm-url] [![Build Status][travis-image]][travis-url] [](https://gitter.im/jspm/jspm?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
|
4
|
+
[![NPM version][npm-image]][npm-url] [![Downloads][downloads-image]][npm-url] [![Build Status][travis-image]][travis-url] [](https://gitter.im/jspm/jspm?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
|
5
5
|
|
|
6
6
|
Registry and format agnostic JavaScript package manager.
|
|
7
7
|
|
package/docs/getting-started.md
CHANGED
|
@@ -6,11 +6,12 @@ There are three main workflows for production:
|
|
|
6
6
|
|
|
7
7
|
### Creating a Bundle
|
|
8
8
|
|
|
9
|
+
***Important**: The module names such as `app/main` used in the examples below should only be `/` separated (On Windows, do NOT use `\` as your path separator for this argument). The module names are specified in URL space; in particular, they are not file-paths.*
|
|
10
|
+
|
|
9
11
|
```
|
|
10
12
|
jspm bundle app/main build.js
|
|
11
13
|
```
|
|
12
|
-
|
|
13
|
-
Creates a file `build.js` containing `app/main` and all its dependencies referenced in config.js.
|
|
14
|
+
Creates a file `build.js` containing `app/main` and all its dependencies referenced in config.js. \
|
|
14
15
|
|
|
15
16
|
We can then load this with a script tag in the page:
|
|
16
17
|
|
package/lib/core.js
CHANGED
|
@@ -290,7 +290,7 @@ function dl(name, repo, version) {
|
|
|
290
290
|
|
|
291
291
|
return endpoint.download(pkg.package, vMatch, vMatchLookup.hash, vMatchLookup.meta, dlDir)
|
|
292
292
|
.then(function() {
|
|
293
|
-
return fs.writeFile(path.resolve(dlDir, '.hash'), vMatchLookup.hash);
|
|
293
|
+
return asp(fs.writeFile)(path.resolve(dlDir, '.hash'), vMatchLookup.hash);
|
|
294
294
|
});
|
|
295
295
|
})
|
|
296
296
|
.then(function() {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "jspm",
|
|
3
3
|
"description": "Registry and format agnostic JavaScript package manager",
|
|
4
|
-
"version": "0.16.
|
|
4
|
+
"version": "0.16.55",
|
|
5
5
|
"main": "./api.js",
|
|
6
6
|
"author": "",
|
|
7
7
|
"dependencies": {
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"core-js": "^1.2.6",
|
|
10
10
|
"glob": "^6.0.1",
|
|
11
11
|
"graceful-fs": "^4.1.2",
|
|
12
|
-
"jspm-github": "^0.13.
|
|
12
|
+
"jspm-github": "^0.13.19",
|
|
13
13
|
"jspm-npm": "^0.26.12",
|
|
14
14
|
"jspm-registry": "^0.4.0",
|
|
15
15
|
"liftoff": "^2.2.0",
|
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
"rimraf": "^2.4.4",
|
|
22
22
|
"rsvp": "^3.1.0",
|
|
23
23
|
"semver": "^5.1.0",
|
|
24
|
-
"systemjs": "0.19.
|
|
25
|
-
"systemjs-builder": "0.15.
|
|
24
|
+
"systemjs": "0.19.46",
|
|
25
|
+
"systemjs-builder": "0.15.36",
|
|
26
26
|
"traceur": "0.0.105",
|
|
27
27
|
"uglify-js": "^2.6.1"
|
|
28
28
|
},
|
package/docs/_book/api.html
DELETED
|
@@ -1,449 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE HTML>
|
|
2
|
-
<html lang="en" >
|
|
3
|
-
|
|
4
|
-
<head>
|
|
5
|
-
|
|
6
|
-
<meta charset="UTF-8">
|
|
7
|
-
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
|
8
|
-
<title>API | JSPM</title>
|
|
9
|
-
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
|
|
10
|
-
<meta name="description" content="">
|
|
11
|
-
<meta name="generator" content="GitBook 2.6.3">
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
<meta name="HandheldFriendly" content="true"/>
|
|
15
|
-
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
|
|
16
|
-
<meta name="apple-mobile-web-app-capable" content="yes">
|
|
17
|
-
<meta name="apple-mobile-web-app-status-bar-style" content="black">
|
|
18
|
-
<link rel="apple-touch-icon-precomposed" sizes="152x152" href="gitbook/images/apple-touch-icon-precomposed-152.png">
|
|
19
|
-
<link rel="shortcut icon" href="gitbook/images/favicon.ico" type="image/x-icon">
|
|
20
|
-
|
|
21
|
-
<link rel="stylesheet" href="gitbook/style.css">
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
<link rel="stylesheet" href="gitbook/plugins/gitbook-plugin-highlight/website.css">
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
<link rel="stylesheet" href="gitbook/plugins/gitbook-plugin-search/search.css">
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
<link rel="stylesheet" href="gitbook/plugins/gitbook-plugin-fontsettings/website.css">
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
<link rel="next" href="./plugins.html" />
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
<link rel="prev" href="./linking.html" />
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
</head>
|
|
48
|
-
<body>
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
<div class="book"
|
|
52
|
-
data-level="4"
|
|
53
|
-
data-chapter-title="API"
|
|
54
|
-
data-filepath="api.md"
|
|
55
|
-
data-basepath="."
|
|
56
|
-
data-revision="Mon Jan 25 2016 15:22:58 GMT+0200 (SAST)"
|
|
57
|
-
data-innerlanguage="">
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
<div class="book-summary">
|
|
61
|
-
<nav role="navigation">
|
|
62
|
-
<ul class="summary">
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
<li class="chapter " data-level="0" data-path="index.html">
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
<a href="./index.html">
|
|
76
|
-
|
|
77
|
-
<i class="fa fa-check"></i>
|
|
78
|
-
|
|
79
|
-
Introduction
|
|
80
|
-
</a>
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
</li>
|
|
84
|
-
|
|
85
|
-
<li class="chapter " data-level="1" data-path="getting-started.html">
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
<a href="./getting-started.html">
|
|
89
|
-
|
|
90
|
-
<i class="fa fa-check"></i>
|
|
91
|
-
|
|
92
|
-
<b>1.</b>
|
|
93
|
-
|
|
94
|
-
Getting Started
|
|
95
|
-
</a>
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
</li>
|
|
99
|
-
|
|
100
|
-
<li class="chapter " data-level="2" data-path="installing-packages.html">
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
<a href="./installing-packages.html">
|
|
104
|
-
|
|
105
|
-
<i class="fa fa-check"></i>
|
|
106
|
-
|
|
107
|
-
<b>2.</b>
|
|
108
|
-
|
|
109
|
-
Installing Packages
|
|
110
|
-
</a>
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
</li>
|
|
114
|
-
|
|
115
|
-
<li class="chapter " data-level="3" data-path="linking.html">
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
<a href="./linking.html">
|
|
119
|
-
|
|
120
|
-
<i class="fa fa-check"></i>
|
|
121
|
-
|
|
122
|
-
<b>3.</b>
|
|
123
|
-
|
|
124
|
-
Linking
|
|
125
|
-
</a>
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
</li>
|
|
129
|
-
|
|
130
|
-
<li class="chapter active" data-level="4" data-path="api.html">
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
<a href="./api.html">
|
|
134
|
-
|
|
135
|
-
<i class="fa fa-check"></i>
|
|
136
|
-
|
|
137
|
-
<b>4.</b>
|
|
138
|
-
|
|
139
|
-
API
|
|
140
|
-
</a>
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
</li>
|
|
144
|
-
|
|
145
|
-
<li class="chapter " data-level="5" data-path="plugins.html">
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
<a href="./plugins.html">
|
|
149
|
-
|
|
150
|
-
<i class="fa fa-check"></i>
|
|
151
|
-
|
|
152
|
-
<b>5.</b>
|
|
153
|
-
|
|
154
|
-
Plugins
|
|
155
|
-
</a>
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
</li>
|
|
159
|
-
|
|
160
|
-
<li class="chapter " data-level="6" data-path="production-workflows.html">
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
<a href="./production-workflows.html">
|
|
164
|
-
|
|
165
|
-
<i class="fa fa-check"></i>
|
|
166
|
-
|
|
167
|
-
<b>6.</b>
|
|
168
|
-
|
|
169
|
-
Production Workflows
|
|
170
|
-
</a>
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
</li>
|
|
174
|
-
|
|
175
|
-
<li class="chapter " data-level="7" data-path="publishing-packages.html">
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
<a href="./publishing-packages.html">
|
|
179
|
-
|
|
180
|
-
<i class="fa fa-check"></i>
|
|
181
|
-
|
|
182
|
-
<b>7.</b>
|
|
183
|
-
|
|
184
|
-
Publishing Packages
|
|
185
|
-
</a>
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
</li>
|
|
189
|
-
|
|
190
|
-
<li class="chapter " data-level="8" data-path="nodejs-usage.html">
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
<a href="./nodejs-usage.html">
|
|
194
|
-
|
|
195
|
-
<i class="fa fa-check"></i>
|
|
196
|
-
|
|
197
|
-
<b>8.</b>
|
|
198
|
-
|
|
199
|
-
NodeJS Usage
|
|
200
|
-
</a>
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
</li>
|
|
204
|
-
|
|
205
|
-
<li class="chapter " data-level="9" data-path="registries.html">
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
<a href="./registries.html">
|
|
209
|
-
|
|
210
|
-
<i class="fa fa-check"></i>
|
|
211
|
-
|
|
212
|
-
<b>9.</b>
|
|
213
|
-
|
|
214
|
-
Registries
|
|
215
|
-
</a>
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
</li>
|
|
219
|
-
|
|
220
|
-
<li class="chapter " data-level="10" data-path="registry-api.html">
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
<a href="./registry-api.html">
|
|
224
|
-
|
|
225
|
-
<i class="fa fa-check"></i>
|
|
226
|
-
|
|
227
|
-
<b>10.</b>
|
|
228
|
-
|
|
229
|
-
Registry API
|
|
230
|
-
</a>
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
</li>
|
|
234
|
-
|
|
235
|
-
<li class="chapter " data-level="11" data-path="registry-property.html">
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
<a href="./registry-property.html">
|
|
239
|
-
|
|
240
|
-
<i class="fa fa-check"></i>
|
|
241
|
-
|
|
242
|
-
<b>11.</b>
|
|
243
|
-
|
|
244
|
-
Registry Property
|
|
245
|
-
</a>
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
</li>
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
<li class="divider"></li>
|
|
254
|
-
<li>
|
|
255
|
-
<a href="https://www.gitbook.com" target="blank" class="gitbook-link">
|
|
256
|
-
Published with GitBook
|
|
257
|
-
</a>
|
|
258
|
-
</li>
|
|
259
|
-
|
|
260
|
-
</ul>
|
|
261
|
-
</nav>
|
|
262
|
-
</div>
|
|
263
|
-
|
|
264
|
-
<div class="book-body">
|
|
265
|
-
<div class="body-inner">
|
|
266
|
-
<div class="book-header" role="navigation">
|
|
267
|
-
<!-- Actions Left -->
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
<!-- Title -->
|
|
271
|
-
<h1>
|
|
272
|
-
<i class="fa fa-circle-o-notch fa-spin"></i>
|
|
273
|
-
<a href="./" >JSPM</a>
|
|
274
|
-
</h1>
|
|
275
|
-
</div>
|
|
276
|
-
|
|
277
|
-
<div class="page-wrapper" tabindex="-1" role="main">
|
|
278
|
-
<div class="page-inner">
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
<section class="normal" id="section-">
|
|
282
|
-
|
|
283
|
-
<p>jspm can be installed and used as an API dependency in a Node project:</p>
|
|
284
|
-
<pre><code> npm install jspm
|
|
285
|
-
</code></pre><pre><code class="lang-javascript"> <span class="hljs-keyword">var</span> jspm = <span class="hljs-built_in">require</span>(<span class="hljs-string">'jspm'</span>);
|
|
286
|
-
jspm.install(<span class="hljs-string">'jquery'</span>); <span class="hljs-comment">// etc</span>
|
|
287
|
-
</code></pre>
|
|
288
|
-
<p>The API is currently unstable and subject to change. The API is also lacking most jspm functions. New API suggestions or adjustments are always welcome, and PRs would be taken gladly.</p>
|
|
289
|
-
<h2 id="jspm-api-version-02">jspm API version 0.2</h2>
|
|
290
|
-
<h4 id="setpackagepathpackagepath">setPackagePath(packagePath)</h4>
|
|
291
|
-
<p>Sets the directory where the jspm <code>package.json</code> file for the package being acted on is to be found.</p>
|
|
292
|
-
<p>Must be run before any other API calls.</p>
|
|
293
|
-
<h3 id="loader-api">Loader API</h3>
|
|
294
|
-
<h4 id="import">import</h4>
|
|
295
|
-
<p>Loads a module in the jspm project in Node:</p>
|
|
296
|
-
<pre><code class="lang-javascript"><span class="hljs-keyword">var</span> jspm = <span class="hljs-built_in">require</span>(<span class="hljs-string">'jspm'</span>);
|
|
297
|
-
jspm.setPackagePath(<span class="hljs-string">'.'</span>);
|
|
298
|
-
|
|
299
|
-
jspm.import(<span class="hljs-string">'fs'</span>).then(<span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params">fs</span>) </span>{
|
|
300
|
-
<span class="hljs-built_in">console</span>.log(fs.readFileSync(<span class="hljs-string">'./package.json'</span>));
|
|
301
|
-
});
|
|
302
|
-
</code></pre>
|
|
303
|
-
<p>jspm supports all Node libraries on the server and uses their Browserify equivalents in the browser.</p>
|
|
304
|
-
<p><a href="nodejs-usage.html">Read more about NodeJS usage of jspm</a>.</p>
|
|
305
|
-
<h4 id="normalizename-parentname--promisenormalized">normalize(name, parentName) -> Promise(normalized)</h4>
|
|
306
|
-
<p>Normalize a module name within the current jspm project.</p>
|
|
307
|
-
<h4 id="class-loader">class Loader</h4>
|
|
308
|
-
<p>For more loader flexibility within the API, a new custom SystemJS loader instance can be created
|
|
309
|
-
based on the current jspm environment:</p>
|
|
310
|
-
<pre><code class="lang-javascript"><span class="hljs-keyword">var</span> jspm = <span class="hljs-built_in">require</span>(<span class="hljs-string">'jspm'</span>);
|
|
311
|
-
jspm.setPackagePath(<span class="hljs-string">'.'</span>); <span class="hljs-comment">// optional</span>
|
|
312
|
-
|
|
313
|
-
<span class="hljs-keyword">var</span> mySystem = <span class="hljs-keyword">new</span> jspm.Loader();
|
|
314
|
-
|
|
315
|
-
<span class="hljs-comment">// can be used as any other System instance</span>
|
|
316
|
-
mySystem.normalize(<span class="hljs-string">'moduleName'</span>).then(<span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params">normalized</span>) </span>{
|
|
317
|
-
|
|
318
|
-
});
|
|
319
|
-
mySystem.import(<span class="hljs-string">'moduleName'</span>).then(<span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params">module</span>) </span>{
|
|
320
|
-
|
|
321
|
-
});
|
|
322
|
-
</code></pre>
|
|
323
|
-
<p><a href="https://github.com/systemjs/systemjs/blob/master/docs/system-api.md" target="_blank">Read more on the SystemJS API</a></p>
|
|
324
|
-
<h3 id="bundle-api">Bundle API</h3>
|
|
325
|
-
<h4 id="bundleexpression-filename-options--promise">bundle(expression, fileName, options) -> Promise()</h4>
|
|
326
|
-
<pre><code class="lang-javascript"><span class="hljs-comment">// jspm bundle app/main build.js --no-mangle</span>
|
|
327
|
-
<span class="hljs-keyword">var</span> jspm = <span class="hljs-built_in">require</span>(<span class="hljs-string">'jspm'</span>);
|
|
328
|
-
jspm.setPackagePath(<span class="hljs-string">'.'</span>);
|
|
329
|
-
jspm.bundle(<span class="hljs-string">'app/main'</span>, <span class="hljs-string">'build.js'</span>, { mangle: <span class="hljs-literal">false</span> }).then(<span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params"></span>) </span>{
|
|
330
|
-
});
|
|
331
|
-
</code></pre>
|
|
332
|
-
<p>Set the <code>inject</code> option to inject the bundle tree into the configuration file.</p>
|
|
333
|
-
<h3 id="unbundle--promise">unbundle() -> Promise()</h3>
|
|
334
|
-
<p>Removes any existing <code>depCache</code> or <code>bundle</code> configuration from the configuration file.</p>
|
|
335
|
-
<h4 id="bundlesfxmodulename-filename-options--promise">bundleSFX(moduleName, fileName, options) -> Promise()</h4>
|
|
336
|
-
<p>Creates a single self-executing bundle for a module.</p>
|
|
337
|
-
<h5 id="bundle-options">Bundle Options</h5>
|
|
338
|
-
<p>Both <code>bundle</code> and <code>bundleSFX</code> support the following options:</p>
|
|
339
|
-
<ul>
|
|
340
|
-
<li><code>minify</code>: Use minification, defaults to true.</li>
|
|
341
|
-
<li><code>mangle</code>: Use mangling with minification, defaults to true.</li>
|
|
342
|
-
<li><code>lowResSourceMaps</code>: Use faster low-resolution source maps, defaults to true.</li>
|
|
343
|
-
<li><code>sourceMaps</code>: Use source maps, defaults to true.</li>
|
|
344
|
-
</ul>
|
|
345
|
-
<h4 id="class-builder">class Builder</h4>
|
|
346
|
-
<p>When more build flexibility is needed, create a custom SystemJS Builder instance for the current jspm environment via:</p>
|
|
347
|
-
<pre><code class="lang-javascript"><span class="hljs-keyword">var</span> jspm = <span class="hljs-built_in">require</span>(<span class="hljs-string">'jspm'</span>);
|
|
348
|
-
jspm.setPackagePath(<span class="hljs-string">'.'</span>); <span class="hljs-comment">// optional</span>
|
|
349
|
-
|
|
350
|
-
<span class="hljs-keyword">var</span> builder = <span class="hljs-keyword">new</span> jspm.Builder();
|
|
351
|
-
|
|
352
|
-
builder.config({ custom: <span class="hljs-string">'options'</span> });
|
|
353
|
-
|
|
354
|
-
<span class="hljs-comment">// or builder.buildStatic</span>
|
|
355
|
-
builder.bundle(<span class="hljs-string">'app/main.js'</span>, {
|
|
356
|
-
minify: <span class="hljs-literal">true</span>
|
|
357
|
-
})
|
|
358
|
-
.then(<span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params">output</span>) </span>{
|
|
359
|
-
<span class="hljs-comment">// output is now an in-memory build</span>
|
|
360
|
-
<span class="hljs-comment">// output.source</span>
|
|
361
|
-
|
|
362
|
-
<span class="hljs-comment">// get the depCache configuration for the tree</span>
|
|
363
|
-
<span class="hljs-keyword">var</span> depCache = builder.getDepCache(output.tree);
|
|
364
|
-
});
|
|
365
|
-
</code></pre>
|
|
366
|
-
<p>The builder will be automatically configured to have the correct jspm configuration and baseURL for the environment.</p>
|
|
367
|
-
<p><a href="https://github.com/systemjs/builder" target="_blank">Read more on the builder API at the SystemJS builder project page</a></p>
|
|
368
|
-
<h3 id="package-manager-api">Package Manager API</h3>
|
|
369
|
-
<h4 id="dlloader--promise">dlLoader -> Promise()</h4>
|
|
370
|
-
<p>Downloads the loader files if needed.</p>
|
|
371
|
-
<h4 id="installname-target--options--promise">install(name [,target] [, options]) -> Promise()</h4>
|
|
372
|
-
<h4 id="installtargets--options--promise">install(targets [, options]) -> Promise()</h4>
|
|
373
|
-
<h4 id="installtrue--options--promise">install(true [, options]) -> Promise()</h4>
|
|
374
|
-
<p>Installs the given package or packages.</p>
|
|
375
|
-
<pre><code class="lang-javascript"><span class="hljs-comment">// jspm install jquery</span>
|
|
376
|
-
jspm.install(<span class="hljs-string">'jquery'</span>)
|
|
377
|
-
|
|
378
|
-
<span class="hljs-comment">// jspm install jquery=github:components/jquery@^2.0.0</span>
|
|
379
|
-
jspm.install(<span class="hljs-string">'jquery'</span>, <span class="hljs-string">'github:components/jquery@^2.0.0'</span>)
|
|
380
|
-
|
|
381
|
-
<span class="hljs-comment">// jspm install jquery=2</span>
|
|
382
|
-
<span class="hljs-comment">// jspm install jquery@2</span>
|
|
383
|
-
jspm.install(<span class="hljs-string">'jquery'</span>, <span class="hljs-string">'2'</span>)
|
|
384
|
-
|
|
385
|
-
<span class="hljs-comment">// jspm install jquery --force</span>
|
|
386
|
-
jspm.install(<span class="hljs-string">'jquery'</span>, { force: <span class="hljs-literal">true</span> })
|
|
387
|
-
|
|
388
|
-
<span class="hljs-comment">// jspm install jquery@1.2.3 bootstrap --link</span>
|
|
389
|
-
jspm.install({ jquery: <span class="hljs-string">'1.2.3'</span>, <span class="hljs-string">'bootstrap'</span>: <span class="hljs-literal">true</span> }, { link: <span class="hljs-literal">true</span> })
|
|
390
|
-
|
|
391
|
-
<span class="hljs-comment">// jspm install</span>
|
|
392
|
-
<span class="hljs-comment">// reproducible install from package.json</span>
|
|
393
|
-
jspm.install(<span class="hljs-literal">true</span>, { lock: <span class="hljs-literal">true</span> })
|
|
394
|
-
</code></pre>
|
|
395
|
-
<h4 id="uninstallname--promise">uninstall(name) -> Promise()</h4>
|
|
396
|
-
<h4 id="uninstallnames--promise">uninstall(names) -> Promise()</h4>
|
|
397
|
-
<p>Can take a single module or array of modules to uninstall.</p>
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
</section>
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
</div>
|
|
404
|
-
</div>
|
|
405
|
-
</div>
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
<a href="./linking.html" class="navigation navigation-prev " aria-label="Previous page: Linking"><i class="fa fa-angle-left"></i></a>
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
<a href="./plugins.html" class="navigation navigation-next " aria-label="Next page: Plugins"><i class="fa fa-angle-right"></i></a>
|
|
412
|
-
|
|
413
|
-
</div>
|
|
414
|
-
</div>
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
<script src="gitbook/app.js"></script>
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
<script src="gitbook/plugins/gitbook-plugin-ga/plugin.js"></script>
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
<script src="gitbook/plugins/gitbook-plugin-search/lunr.min.js"></script>
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
<script src="gitbook/plugins/gitbook-plugin-search/search.js"></script>
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
<script src="gitbook/plugins/gitbook-plugin-sharing/buttons.js"></script>
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
<script src="gitbook/plugins/gitbook-plugin-fontsettings/buttons.js"></script>
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
<script>
|
|
440
|
-
require(["gitbook"], function(gitbook) {
|
|
441
|
-
var config = {"ga":{"token":"UA-40327700-1","configuration":"auto"},"highlight":{},"search":{"maxIndexSize":1000000},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2}};
|
|
442
|
-
gitbook.start(config);
|
|
443
|
-
});
|
|
444
|
-
</script>
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
</body>
|
|
448
|
-
|
|
449
|
-
</html>
|