mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
Use a shared tsconfig.
Don't duplicate compiler options across projects.
This commit is contained in:
11
gruntfile.js
11
gruntfile.js
@@ -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,
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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/",
|
||||
|
||||
@@ -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
20
tsconfig.shared.json
Normal 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"
|
||||
]
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user