shlomiassaf / ngc-webpack

Angular compiler-cli with webpack's loader chain.
MIT License
84 stars 15 forks source link

Cannot set property 'disable' of undefined (tsconfig inheritance) #31

Open YuliaTsareva opened 7 years ago

YuliaTsareva commented 7 years ago

It seems that tsconfigs with inheritance are not correctly processed.

If config looks like

{
    "extends": "./tsconfig",
    "angularCompilerOptions": {
        "genDir": "./compiled",
        "skipMetadataEmit": true
    }
}

an error occurs at text-based-loader/loader.ts because there is no compilerOptions.

Module build failed: TypeError: Cannot set property 'disable' of undefined

See https://github.com/shlomiassaf/ngc-webpack/blob/master/src/aot-clean-transformer/loader/text-based-loader/loader.ts#L269

For now I add empty compilerOptions as a workaround:

{
    "extends": "./tsconfig",
    "compilerOptions": {},
    "angularCompilerOptions": {
        "genDir": "./compiled",
        "skipMetadataEmit": true
    }
}