编译打字稿后的路径

时间:2015-12-31 10:12:18

标签: typescript

这是我的文件夹结构

/js 
    /dev
        /admin
            app.component.ts
    /public
tsconfig.json

这是我的tsconfig.json文件

{
  "compilerOptions": {
    "target": "ES5",
    "module": "system",
    "moduleResolution": "node",
    "outDir": "./js/public",
    "rootDir": "./js/dev",
    "sourceMap": true,
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "removeComments": false,
    "noImplicitAny": false
  },
  "exclude": [
    "node_modules"
  ]
}

问题是编译后的结构是:

/js 
    /dev
        /admin
            app.component.ts
    /public
        /js
            /dev
                /admin
                    app.component.js
tsconfig.json

我想要

/js 
    /dev
        /admin
            app.component.ts
    /public
        /admin
            app.component.js
tsconfig.json

1 个答案:

答案 0 :(得分:1)

  1. 将您的tsconfig.json移至'/js/dev/'
  2. 将您的outDir媒体资源修改为'../public'