Skip to content

Commit

Permalink
fix: support Angular 6 cli
Browse files Browse the repository at this point in the history
  • Loading branch information
hotforfeature committed Jul 18, 2018
1 parent 8305b48 commit 649290c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@
"tslib": "^1.7.1"
},
"peerDependencies": {
"@angular/cli": ">=1.6.3 < 1.8",
"@angular/cli": ">=1.6.3",
"@angular/core": ">=4.0.0",
"@angular/forms": ">=4.0.0",
"@angular/platform-browser": ">=4.0.0",
"rxjs": "^5.0.1"
"rxjs": ">=5.0.1"
},
"devDependencies": {
"@angular/common": "^5.0.0",
Expand Down
13 changes: 5 additions & 8 deletions patch-cli.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
const fs = require('fs');
const path = require('path');

const commonPath = path.resolve(
let commonPath = path.resolve(
__dirname,
'../../@angular-devkit/build-angular/src/angular-cli-files/models/webpack-configs/common.js'
);

const isNg6 = fs.existsSync(commonPath);
if (!isNg6) {
commonPath = path.resolve(
Expand All @@ -14,14 +15,10 @@ if (!isNg6) {
}
const stylesPath = path.resolve(
__dirname,
'../../@angular-devkit/build-angular/src/angular-cli-files/models/webpack-configs/styles.js'
isNg6
? '../../@angular-devkit/build-angular/src/angular-cli-files/models/webpack-configs/styles.js'
: '../../@angular/cli/models/webpack-configs/styles.js'
);
if (!fs.existsSync(stylesPath)) {
stylesPath = path.resolve(
__dirname,
'../../@angular/cli/models/webpack-configs/styles.js'
);
}

let data = fs.readFileSync(commonPath, 'utf8');
if (!data.includes('/* Origami Patched */')) {
Expand Down

0 comments on commit 649290c

Please sign in to comment.