Simple dev/prod build for Angular (2+) using gulp, systemjs, rollup, ngc (AOT), scss, Visual Studio
MIT License
Simple dev/prod gulp build for Angular (2+) using systemjs, rollup, ngc (AOT), scss, and with dev/prod servers via express.
npm install gulp -g
npm install
gulp build-dev --color
Development build includes compilation of SCSS and TypeScript, and bundling of rxjs to single file.
gulp build-prod --color
Production build includes compilation of SCSS, AOT compilation and tree-shaking with Rollup. All result files moved to dist
dir. Production build output do not conflicts with development.
npm start
Server will be listening on http://localhost:8181.
npm run start-prod
Server will be listening on http://localhost:8282, with gzip content compression enabled.
gulp build-dev --color
from terminal, to make rxjs bundle.TypeScript and SCSS set up to be compiled on file save. SystemJS loads every file separately, so you only need save your changes, and reload browser window.
To force recompilation of all files make rebuild of the solution (Alt+B, Alt+R). To force recompilation of SCSS file, right click -> Web Compiler -> Re-compile file
If library should be imported via import
statement into TypeScript, then:
tsconfig.json
, and make sure, that SystemJS will find it by buid-tools/systemjs-config.json
. In some cases nothing needed, in some cases you should map library name to its path, as it made for @angular modules.tsconfig.ngc.json
, tsconfig.prod.json
and make sure, that Rollup will find it by build-tools/rollup-config.js
. In most cases, rollup-plugin-node-resolve
plugin will make the work without any setup.If library should not be imported, and its only needed to add it page, then:
<script>
tag into index.html
in section <!-- development -->
.build.prod.js
to function commonBundle
; you can specify full path, or use pathTools.resolvePackagePath
funciton to automaticly resolve library path.packageConfigPaths
in systemjs-config does not work.See branch hash-routing for enabling hash location strategy, instead of HTML5. See branch http2 for testing spdy in development server. By the way, there is no perfomance boost achieved.