Buslowicz / twc

TypeScript based, boilerplate-less, Polymer toolbox friendly Polymer Modules
32 stars 1 forks source link

TWC throws with empty tsconfig.json #45

Closed tpluscode closed 7 years ago

tpluscode commented 7 years ago

When the tsconfig.json is empty or lacks compilerOptions section, twc fails with the following error

\npm\node_modules\twc\src\index.js:16
    return Object.assign(co, override);
                  ^

TypeError: Cannot convert undefined or null to object
    at Function.assign (native)
    at getFullConfig (\npm\node_modules\twc\src\index.js:16:19)
    at ts2html (\npm\node_modules\twc\src\index.js:24:34)
    at Object.<anonymous> (\npm\node_modules\twc\src\cli.js:16:5)
    at Module._compile (module.js:413:34)
    at Object.Module._extensions..js (module.js:422:10)
    at Module.load (module.js:357:32)
    at Function.Module._load (module.js:314:12)
    at Function.Module.runMain (module.js:447:10)
    at startup (node.js:139:18)
tpluscode commented 7 years ago

I think there's a regression in 0.2.0-beta.1. Again, when the compilerOptions is missing, twc throws.

\npm\node_modules\twc\src\cli.js:75
var _a = tsConfig.compilerOptions, outDir = _a.outDir, declaration = _a.declaration, declarationDir = _a.declarationDir;
                                              ^

TypeError: Cannot read property 'outDir' of undefined
Buslowicz commented 7 years ago

This issue will be fixed once #73 is finished (I am currently working on it as it will make it easier to finish #39 and #48).