├── .gitignore
├── LICENSE
├── README.md
├── agnular-gulp-starter.sln
├── angular-gulp-starter.csproj
├── angular-gulp-starter.csproj.user
├── app
├── app-routing.module.ts
├── app.component.scss
├── app.component.ts
├── app.module.ts
├── dashboard
│ ├── dashboard-exports.ts
│ ├── dashboard-imports.ts
│ ├── dashboard-routing.module.ts
│ ├── dashboard.component
│ │ ├── dashboard.component.html
│ │ ├── dashboard.component.scss
│ │ └── dashboard.component.ts
│ └── dashboard.module.ts
├── heroes
│ ├── hero-detail.component
│ │ ├── hero-detail.component.html
│ │ ├── hero-detail.component.scss
│ │ └── hero-detail.component.ts
│ ├── hero-search.component
│ │ ├── hero-search.component.html
│ │ ├── hero-search.component.scss
│ │ ├── hero-search.component.ts
│ │ └── hero-search.service.ts
│ ├── heroes-exports.ts
│ ├── heroes-imports.ts
│ ├── heroes-routing.module.ts
│ ├── heroes.component
│ │ ├── heroes.component.html
│ │ ├── heroes.component.scss
│ │ └── heroes.component.ts
│ ├── heroes.module.ts
│ └── services
│ │ ├── hero.service.ts
│ │ └── mock-heroes.ts
├── main-aot.ts
├── main.ts
├── models
│ ├── hero.ts
│ └── models-exports.ts
└── rxjs-extensions.ts
├── assets
├── gif-load.gif
├── global.css
├── global.min.css
└── global.scss
├── build-tools
├── build-scripts
│ ├── bundling.js
│ ├── compilation.js
│ └── path-tools.js
├── express-http-server.dev.js
├── express-http-server.prod.js
├── rollup-config.js
├── systemjs-config.js
├── tsconfig.rxjs-to-es6.json
└── variables.js
├── build.common.js
├── build.dev.js
├── build.prod.js
├── compilerconfig.json
├── compilerconfig.json.defaults
├── gulpfile.js
├── index.html
├── package.json
├── tsconfig.json
├── tsconfig.ngc.json
└── tsconfig.prod.json
/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules
2 | dist-dev
3 | temp
4 | app-aot
5 | app/**/*.js
6 | app/**/*.js.map
7 | app/**/*.css
8 | app/**/*.metadata.json
9 | npm-debug.log
10 | typings
11 | obj
12 | bin
13 | dist
14 | .vs
15 | rxjs-es
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2017 PFight
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Angular gulp starter
2 | Simple dev/prod gulp build for Angular (2+) using systemjs, rollup, ngc (AOT), scss, and with dev/prod servers via express.
3 |
4 | ### Setup
5 |
6 | npm install gulp -g
7 | npm install
8 |
9 | ### See in action
10 |
11 | [Try DEV build online](https://pfight.github.io/angular-gulp-starter-online-dev/)
12 |
13 | [Try PROD build online](https://pfight.github.io/angular-gulp-starter-online-prod)
14 |
15 | ### Commands
16 |
17 | ##### Development buid
18 |
19 | gulp build-dev --color
20 |
21 | Development build includes compilation of SCSS and TypeScript, and bundling of rxjs to single file.
22 |
23 | ##### Production build
24 |
25 | gulp build-prod --color
26 |
27 | 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.
28 |
29 | ##### Start develoment server
30 |
31 | npm start
32 |
33 | Server will be listening on [http://localhost:8181](http://localhost:8181).
34 |
35 | ##### Start production test server
36 |
37 | npm run start-prod
38 |
39 | Server will be listening on [http://localhost:8282](http://localhost:8282), with gzip content compression enabled.
40 |
41 | ### Using Visual Studio
42 |
43 | ##### Setup
44 |
45 | 1. Setup [Visual Studio 2015](https://www.visualstudio.com/downloads/) (for example, Community Edition)
46 | 2. Setup [TypeScript for Visual Studio 2015](https://www.microsoft.com/ru-ru/download/confirmation.aspx?id=48593)
47 | 3. Setup [Web Compiler](https://marketplace.visualstudio.com/items?itemName=MadsKristensen.WebCompiler) extension for working with SCSS from IDE.
48 | 4. Run `gulp build-dev --color` from terminal, to make rxjs bundle.
49 |
50 | ##### Working
51 |
52 | 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.
53 |
54 | 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`
55 |
56 | ### Installing dependencies
57 |
58 | If library should be imported via `import` statement into TypeScript, then:
59 |
60 | 1. For development: make sure, that TypeScript will find this library with `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.
61 | 2. For production: make sure, that TypeScript will find this library with `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.
62 |
63 | If library should not be imported, and its only needed to add it page, then:
64 |
65 | 1. For devleopment: add `
19 |
20 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
32 |
41 |