Skip to content

Commit 49c36c5

Browse files
Merge pull request #44 from ngx-builders/feat/support-for-angular-10
feat: support angular 10
2 parents 59aef1c + 78fd844 commit 49c36c5

File tree

5 files changed

+15
-4
lines changed

5 files changed

+15
-4
lines changed

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,13 @@ Now whenever you want to analyze your angular project just run a command `ng run
3636
- Example:
3737
- `ng run [YOUR_PROJECT_NAME]:analyze --gzip` – Give the stats of gzip bundle.
3838

39+
40+
#### --diffLoading <a name="diffLoading"></a>
41+
- **optional**
42+
- Default: `true` (boolean)
43+
- Example:
44+
- `ng run [YOUR_PROJECT_NAME]:analyze --diffLoading=false` – A new Angular 10 project will have differential loading set to false, but if you upgrade from previous version and have differential loading enabled it will remain the same. This flag is for backward compatibilily. You can skip this option is differential loading is enabled.
45+
3946
# License
4047
[MIT](https://github.com/ngx-builders/source-map-analyzer/blob/master/LICENSE)
4148

analyze/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export default createBuilder<any>(
2828
const result = await build.result;
2929

3030
if (result.success) {
31-
const mainFile = '*es2015.*.js';
31+
const mainFile = builderConfig.diffLoading ? '*es2015.*.js' : '*.js';
3232
let explorerCommand = `npx source-map-explorer ${builderConfig.outputPath}/${mainFile}`;
3333
if (builderConfig.gzip) {
3434
explorerCommand = `${explorerCommand} --gzip`;

analyze/schema.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
export interface Schema {
22
outputPath: string;
33
gzip?: boolean;
4+
diffLoading?:boolean;
45
}

analyze/schema.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@
77
},
88
"outputPath": {
99
"type": "string"
10+
},
11+
"diffLoading": {
12+
"type":"boolean",
13+
"default": true
1014
}
1115
}
1216
}

package.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,8 @@
3838
"typescript": "3.9.2"
3939
},
4040
"dependencies": {
41-
"@angular-devkit/architect": "^0.901.0",
42-
"@angular-devkit/core": "^9.1.0",
43-
"inquirer": "^7.1.0",
41+
"@angular-devkit/architect": "0.1000.1",
42+
"@angular-devkit/core": "10.0.1",
4443
"schematics-utilities": "^2.0.1"
4544
}
4645
}

0 commit comments

Comments
 (0)