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
Post a Comment