angular - How to use JSPM to convert an Angular2 app into a single .js file? -


what simple steps can convert angular2 app single (or few) .js files?

the angular2 app runs on local machine, uses node_modules folder close 200mb. said jspm can pack needed .js files 1 single file -- how done?

like this. example, if have systemjs config this:

  <!doctype html>     <script src="jspm_packages/system.js"></script>     <script src="config.js"></script>     <script src="build.js"></script>     <script>       system.import('app/main.js');     </script> 

you can bundle this

jspm bundle app/main main-bundle.js --inject 

or, better, (to create output distributable script file can included entirely on own independent):

jspm bundle-sfx app/main.js app.js 

app.js contains micro-loader implementation (1.4kb gzipped), converts module formats es5 (including compiling es6), , maintaining bindings , circular references normal bundles

to use jspm need use systemjs , config.js file. if think link suggested @drewmoore complicated maybe you're not approaching problem correctly.


Comments

Popular posts from this blog

Ansible - ERROR! the field 'hosts' is required but was not set -

customize file_field button ruby on rails -

SoapUI on windows 10 - high DPI/4K scaling issue -