some questions put angular2 web project production environment
- we development on lite server best production? is other server module of
nodejs
? technically can have server (apache, tomcat, etc). - how should source code management below context.
- browser must include
js
files project should have js files when deployed - in standard java project commit
.java
files , uses jenkins (may other tools) compile , make deploy-able structure - should follow same strategy here? i.e. don't commit compiled js files , deploy using
node
compiler takests
files , compiles js
- browser must include
- what best way minify/obfuscate js files
- i know way using
outdir
,outfile
grump
don't want every files tobe included in 1 minified file because kills concept of lazy loading - is there way minify , obfuscate js files on compile time only?
- i know way using
- what
enableprodmode()
do? how different not using it?
here answers questions:
angular2 applications consist of static files can serve static web servers or server applications can define static folders (express, ...)
regarding source code management, must have packaging phase optimize application loading (gater files, uglify, ...). source code must contain typescript files (or js files if using es5 or es6). such packaging can done using gulp example. jenkins server able checkout source code, build , execute tests.
in fact, when not using
outfile
property of typescript compiler, won't able gather js compiled files single 1 since anonymous modules created within each js files.see question more details of this:
regarding prod mode, here extract of documentation:
disable angular's development mode, turns off assertions , other checks within framework.
one important assertion disables verifies change detection pass not result in additional changes bindings (also known unidirectional data flow).
Comments
Post a Comment