diff --git a/package.json b/package.json index d1d6100..ee94e62 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "nativescript-dev-typescript", - "version": "0.3.3", + "version": "0.3.4", "description": "TypeScript support for NativeScript projects. Install using `tns install typescript`.", "scripts": { "test": "exit 0", diff --git a/postinstall.js b/postinstall.js index b2289e2..2724dd0 100644 --- a/postinstall.js +++ b/postinstall.js @@ -34,10 +34,10 @@ function createTsconfig() { noEmitOnError: true, }; - tsconfig.exclude = ['node_modules', 'platforms']; + tsconfig.exclude = ['node_modules', 'platforms', "**/*.aot.ts"]; - if (!fs.existsSync(tsconfigPath)) { - fs.appendFileSync(tsconfigPath, JSON.stringify(tsconfig, null, 4)); + if (!fs.existsSync(tsconfigPath)) { + fs.appendFileSync(tsconfigPath, JSON.stringify(tsconfig, null, 4)); } } @@ -49,7 +49,7 @@ function getProjectTypeScriptVersion() { return (jsonContent.dependencies && jsonContent.dependencies.typescript) || (jsonContent.devDependencies && jsonContent.devDependencies.typescript); - } catch(err) { + } catch (err) { console.error(err); return null; } @@ -57,7 +57,7 @@ function getProjectTypeScriptVersion() { function installTypescript() { var installedTypeScriptVersion = getProjectTypeScriptVersion(); - if(installedTypeScriptVersion) { + if (installedTypeScriptVersion) { console.log("Project already targets TypeScript " + installedTypeScriptVersion); } else { require('child_process').exec('npm install --save-dev typescript', { cwd: projectDir }, function (err, stdout, stderr) {