2016-02-19 148 views
0

我有這個問題,找不到任何答案,解決問題。angularjs代碼不工作後咕嚕build

我用grunt構建系統創建了小的Angularjs代碼。

Bower.json http://pastebin.com/8AScfd7d

Gruntfile.js http://pastebin.com/e0d7QLGG

log.txt的(咕嚕--force)使用咕嚕 http://pastebin.com/MYk9iR53

的index.html http://pastebin.com/B48w0Z58

- 強制命令來建立。

當我運行構建它不顯示任何錯誤在控制檯和netowek選項卡下的所有腳本加載罰款,但沒有任何反應。如果我用源腳本替換縮小腳本標記(我的自定義代碼),它開始工作。

用盡想法可能是錯誤的。

+0

您正在使用grunt作爲服務器嗎?爲什麼不使用nodejs? – webdev5

+0

我沒有使用grunt作爲服務器,我正在使用grunt創建來自源 –

+0

的構建「強制,-f強制你的方式超過警告的方式。」也許嘗試一下,看看它會拋出什麼錯誤? – dgig

回答

0

用gruntfile.js中的ngAnnotate替換了ngMin,並在grunt構建任務中添加了'ngAnnotate:dist'。

/*ngmin: { 
    dist: { 
    files: [{ 
     expand: true, 
     cwd: '.tmp/concat/scripts', 
     src: '*.js', 
     dest: '.tmp/concat/scripts' 
    }] 
    } 
},*/ 
ngAnnotate: { 
      dist: { 
       files: [ 
        { 
         expand: true, 
         cwd: '.tmp/concat/scripts', 
         src: '*.js', 
         dest: '.tmp/concat/scripts' 
        } 
       ] 
      } 
     }