Use a shared tsconfig.

Don't duplicate compiler options across projects.
This commit is contained in:
Hristo Deshev
2017-02-15 13:24:44 +02:00
parent 86481cce4a
commit 7d7e48f759
6 changed files with 27 additions and 74 deletions

View File

@@ -105,7 +105,7 @@ module.exports = function(grunt) {
};
// Configure localCfg
var outDir = tsconfig.compilerOptions.outDir || "./bin/dist";
var outDir = "./bin/dist";
var srcDir = ".";
var tnsCoreModulesDir = path.join(srcDir, "tns-core-modules");;
var srcAppDirs = ["tests/app", "apps/app"]; //Don't move the tests folder from index 0!
@@ -156,15 +156,6 @@ module.exports = function(grunt) {
"!**/*.ios.d.ts"
].concat(localCfg.defaultExcludes);
var tsOptions = tsconfig.compilerOptions;
tsOptions.fast = 'never';
tsOptions.removeComments = !grunt.option('leavecomments') || '';
tsOptions.compiler = "node_modules/typescript/bin/tsc";
tsOptions.failOnTypeErrors = true;
tsOptions.outDir = localCfg.outDir;
var removeCommentsArgument = tsOptions.removeComments ? " --removeComments" : "";
tsOptions.additionalFlags = "--outDir " + localCfg.outDir + removeCommentsArgument;
// Config
grunt.initConfig({
localCfg : localCfg,

View File

@@ -1,20 +1,7 @@
{
"extends": "./tsconfig.shared",
"compilerOptions": {
"noEmit": true,
"noEmitOnError": true,
"noEmitHelpers": true,
"target": "es5",
"module": "commonjs",
"declaration": false,
"noImplicitAny": false,
"noImplicitUseStrict": true,
"experimentalDecorators": true,
"sourceMap": true,
"jsx": "react",
"reactNamespace": "UIBuilder",
"lib": [
"es2016", "dom"
]
"noEmit": true
},
"include": [
"tns-core-modules/**/*.d.ts"

View File

@@ -1,20 +1,7 @@
{
"extends": "./tsconfig.shared",
"compilerOptions": {
"noEmit": true,
"noEmitOnError": true,
"noEmitHelpers": true,
"target": "es5",
"module": "commonjs",
"declaration": false,
"noImplicitAny": false,
"noImplicitUseStrict": true,
"experimentalDecorators": true,
"sourceMap": true,
"jsx": "react",
"reactNamespace": "UIBuilder",
"lib": [
"es6", "dom"
]
"noEmit": true
},
"include": [
"bin/dist/tns-core-modules/tns-core-modules.d.ts"

View File

@@ -1,22 +1,5 @@
{
"compilerOptions": {
"noEmitOnError": false,
"noEmitHelpers": true,
"target": "es5",
"module": "commonjs",
"declaration": false,
"noImplicitAny": false,
"noImplicitUseStrict": true,
"removeComments": true,
"experimentalDecorators": true,
"diagnostics": true,
"sourceMap": true,
"jsx": "react",
"reactNamespace": "UIBuilder",
"lib": [
"es6", "dom"
]
},
"extends": "./tsconfig.shared",
"exclude": [
"tns-platform-declarations/node_modules/",
"tns-platform-declarations/package/",

View File

@@ -1,20 +1,5 @@
{
"compilerOptions": {
"noEmitOnError": true,
"noEmitHelpers": true,
"target": "es5",
"module": "commonjs",
"declaration": false,
"noImplicitAny": false,
"noImplicitUseStrict": true,
"experimentalDecorators": true,
"sourceMap": true,
"jsx": "react",
"reactNamespace": "UIBuilder",
"lib": [
"es2016", "dom"
]
},
"extends": "./tsconfig.shared",
"include": [
"tns-core-modules/js-libs/easysax/**/*.ts",
"tns-core-modules/module.d.ts",

20
tsconfig.shared.json Normal file
View File

@@ -0,0 +1,20 @@
{
"compilerOptions": {
"noEmitOnError": false,
"noEmitHelpers": true,
"target": "es5",
"module": "commonjs",
"declaration": false,
"noImplicitAny": false,
"noImplicitUseStrict": true,
"removeComments": true,
"experimentalDecorators": true,
"diagnostics": true,
"sourceMap": true,
"jsx": "react",
"reactNamespace": "UIBuilder",
"lib": [
"es6", "dom"
]
}
}