Created
October 23, 2020 11:08
-
-
Save bartholomej/989b3c07bf49ba3085701f181476fa58 to your computer and use it in GitHub Desktop.
Angular skip differential loading to speed up build
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"scripts": { | |
"differential:disable": "yarn ts-node --project ./build-scripts/tsconfig.ts-node.json ./build-scripts/skip-differential-loading" | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { writeFileSync } from 'fs'; | |
import { join } from 'path'; | |
import tsConfig from '../tsconfig.json'; | |
const TARGET = 'es5'; | |
const cfg: Record<string, any> = tsConfig; | |
// Disable differential loading to speed up build | |
console.log(`${cfg.compilerOptions.target} -> ${TARGET}`); | |
cfg.compilerOptions.target = TARGET; | |
writeFileSync(join(__dirname, '..', 'tsconfig.json'), JSON.stringify(cfg, null, 2)); | |
console.log('\x1b[34m', `Differential loading was temporarily disabled`); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"extends": "../tsconfig.json", | |
"compilerOptions": { | |
"lib": ["es2020"], | |
"module": "commonjs", | |
"resolveJsonModule": true, | |
"esModuleInterop": true | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment