Skip to content

Commit

Permalink
refactor(hooks): replace hooks to ng-cli fileReplacements logic
Browse files Browse the repository at this point in the history
  • Loading branch information
leo6104 committed May 19, 2018
1 parent 7fbc68c commit c940037
Show file tree
Hide file tree
Showing 14 changed files with 36 additions and 318 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

# Introduction

Bootstrap and package your project with Angular 5(+) and Electron (Typescript + SASS + Hot Reload) for creating Desktop applications.
Bootstrap and package your project with Angular 6(+) and Electron (Typescript + SASS + Hot Reload) for creating Desktop applications.

Currently runs with:

Expand Down
27 changes: 26 additions & 1 deletion angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,23 @@
"scripts": []
},
"configurations": {
"dev": {
"optimization": false,
"outputHashing": "all",
"sourceMap": true,
"extractCss": true,
"namedChunks": false,
"aot": false,
"extractLicenses": true,
"vendorChunk": false,
"buildOptimizer": false,
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.dev.ts"
}
]
},
"production": {
"optimization": true,
"outputHashing": "all",
Expand All @@ -40,7 +57,12 @@
"extractLicenses": true,
"vendorChunk": false,
"buildOptimizer": true,
"fileReplacements": []
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.prod.ts"
}
]
}
}
},
Expand All @@ -50,6 +72,9 @@
"browserTarget": "angular-electron:build"
},
"configurations": {
"dev": {
"browserTarget": "angular-electron:build:dev"
},
"production": {
"browserTarget": "angular-electron:build:production"
}
Expand Down
196 changes: 0 additions & 196 deletions hooks/environments/README.md

This file was deleted.

23 changes: 0 additions & 23 deletions hooks/environments/app.config.ts.tpl

This file was deleted.

20 changes: 0 additions & 20 deletions hooks/environments/set_profile.js

This file was deleted.

23 changes: 0 additions & 23 deletions hooks/src/app/app.config.ts

This file was deleted.

23 changes: 0 additions & 23 deletions hooks/src/app/appconfig.ts

This file was deleted.

7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@
"scripts": {
"postinstall": "npx electron-builder install-app-deps",
"ng": "ng",
"start": "node hooks/environments/set_profile.js && npm-run-all -p ng:serve electron:serve",
"build": "node hooks/environments/set_profile.js && ng build && npm run electron:tsc",
"build:prod": "node hooks/environments/set_profile.js && ng build -c production && npm run electron:tsc",
"start": "npm-run-all -p ng:serve electron:serve",
"build": "npm run electron:tsc && ng build",
"build:dev": "npm run build -- -c dev",
"build:prod": "npm run build -- -c production",
"ng:serve": "ng serve -o",
"electron:tsc": "tsc main.ts",
"electron:serve": "wait-on http-get://localhost:4200/ && npm run electron:tsc && electron . --serve",
Expand Down
2 changes: 1 addition & 1 deletion src/app/app.component.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Component } from '@angular/core';
import { ElectronService } from './providers/electron.service';
import { TranslateService } from '@ngx-translate/core';
import { AppConfig } from './app.config';
import { AppConfig } from '../environments/environment';

@Component({
selector: 'app-root',
Expand Down
23 changes: 0 additions & 23 deletions src/app/app.config.ts

This file was deleted.

Loading

0 comments on commit c940037

Please sign in to comment.