天天看點

[Javascript] An Introduction to JSPM (JavaScript Package Manager)

jspm can handle installed packages, transpiling es6, and bundling all from the command-line. this video gives a quick overview of install jspm, installing packages with jspm, writing a very simple app in es6 that uses those packages, then bundling up for production.

install:

you can use jspm to install any package:

this will help you to create package.json and you need to select some default options such as transplier: babel.

we create index.html, to import system.js and config.js files whcih created by jspm. then use system.js to import the app.js file.

app.js:

in the file we can use es6 already.

then when you open the index.html you will see it works.

run:

this will create a build.js file,

replace html with:

only includes new build.js file, u will see everything still works.

繼續閱讀