我是新來的打字稿,我正在運行一個問題編譯。所以我遇到的問題是,當我保存我的.ts文件時,它們會在兩個不同的位置編譯兩次。TypeScript編譯保存.ts文件兩次
我現在的文件結構是:
-app
|-css (all css files)
|-html (all html files)
|-js (all js files)
|-ts (all ts files)
當我救我的.ts文件被編譯並放置在js文件夾,但隨後一組新的文件夾格式創建:
-app
|-...
|-js (all js files)
|-app
|-ts (all js files [that were saved ts files])
|-...
我一直在尋找任何有類似問題但找不到任何東西的人。我的package.json文件和文件tsconfig.json如下:
的package.json
{
"name": "angular2-quickstart",
"version": "1.0.0",
"scripts": {
"start": "tsc && concurrently \"npm run tsc:w\" \"npm run lite\" ",
"lite": "lite-server",
"postinstall": "typings install",
"tsc": "tsc",
"tsc:w": "tsc -w",
"typings": "typings"
},
"license": "ISC",
"dependencies": {
"@angular/common": "2.0.0-rc.4",
"@angular/compiler": "2.0.0-rc.4",
"@angular/core": "2.0.0-rc.4",
"@angular/forms": "0.2.0",
"@angular/http": "2.0.0-rc.4",
"@angular/platform-browser": "2.0.0-rc.4",
"@angular/platform-browser-dynamic": "2.0.0-rc.4",
"@angular/router": "3.0.0-beta.1",
"@angular/router-deprecated": "2.0.0-rc.2",
"@angular/upgrade": "2.0.0-rc.4",
"angular2-in-memory-web-api": "0.0.14",
"bootstrap": "^3.3.6",
"core-js": "^2.4.0",
"d3": "^4.1.1",
"d3tip": "0.5.0",
"d3-tip": "0.6.7",
"d3-tooltip": "0.0.1",
"moment": "^2.14.1",
"reflect-metadata": "^0.1.3",
"rxjs": "5.0.0-beta.6",
"systemjs": "0.19.27",
"zone.js": "^0.6.12"
},
"devDependencies": {
"concurrently": "^2.0.0",
"lite-server": "^2.2.0",
"typescript": "^1.8.10",
"typings": "^1.0.4"
}
}
tsconfig.json:
{
"compilerOptions": {
"target": "es5",
"module": "commonjs",
"moduleResolution": "node",
"sourceMap": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"removeComments": false,
"noImplicitAny": false,
"outDir": "app/js",
"rootDir": "app/ts"
}
}
UPDATE:還是有這個問題。 - 未解決--07/28/2016--
app/ts是ts文件所在的位置 – christian
您說編譯生成兩個不同位置的文件,它們是什麼? –
它在app/js和app/js/app/ts中創建js文件(也將路徑/ app和/ app/ts添加到app/js/...,因爲它們之前不存在) – christian