2016-11-10 77 views
0

我使用「ng new Sample」來生成一個新的Angular2文件夾。 Angular的版本是2.1.0。 的文件夾結構是:如何使用ng build來生成ts,map和js文件到同一個文件夾中?

angular-cli.json 
karma.conf.js  
package.json  
protractor.conf.js 
README.md   
tslint.json   
node_modules  
e2e     
src  
    ----app  
    ------app.component.css  
    ------app.component.html 
    ------app.component.spec.ts  
    ------app.component.ts  
    ------app.module.ts   
    ------index.ts    

tsconfig.json文件:

{ 
     "compilerOptions": { 
     "outDir": "${workspaceRoot}/debug", 
     "sourceMap": true, 
     //"inlineSources": true, 
     "rootDir": "${workspaceRoot}", 
     "target": "es5", 
     "typeRoots": [ 
      "../node_modules/@types" 
     ] 
     } 
    } 

然後我跑了 「NG建」,下面的文件被輸出到 「DIST」 文件夾中。 但事實上,我沒有在任何配置文件中設置文件夾「dist」。

   Asset  Size Chunks    Chunk Names 
     main.bundle.js 2.75 MB 0, 2 [emitted] main 
    styles.bundle.js 10.2 kB 1, 2 [emitted] styles 
      inline.js 5.53 kB  2 [emitted] inline 
      main.map  2.8 MB 0, 2 [emitted] main 
      styles.map  14 kB 1, 2 [emitted] styles 
      inline.map 5.59 kB  2 [emitted] inline 
      index.html 474 bytes   [emitted] 

我的問題是我怎麼能輸出TS,地圖和js文件到一個文件夾,而不是使用大口分別使用納克構建?什麼是inline.js?爲什麼文件輸出到dist文件夾?

回答

0

如果您檢查您的文件夾,你應該有一個文件名爲:

angular-cli.json 

打開此文件,請訪問:

"apps": [ 
    { 
     "root": "src", 
     "outDir": "dist", 
     "assets": [ 
     "assets", 
     "favicon.ico" 
     ], 

更改路徑,OUTDIR文件夾。

相關問題