简体   繁体   English

grunt构建后angularjs代码不起作用

[英]angularjs code is not working after grunt build

I am having this problem and unable to find any answer which fix the problem. 我遇到了这个问题,无法找到解决问题的答案。

I have created small Angularjs code with grunt build system. 我已经用grunt构建系统创建了小的Angularjs代码。

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

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

log.txt (grunt --force) http://pastebin.com/MYk9iR53 log.txt(咕---force) http://pastebin.com/MYk9iR53

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

using grunt --force command to build. 使用grunt --force命令进行构建。

When I run the build it does not show any errors in console and under netowek tab all script loads fine but nothing happens. 当我运行该版本时,它不会在控制台中显示任何错误,并且在netowek选项卡下,所有脚本都可以正常加载,但没有任何反应。 If I replace the minified script tag (my custom code) with the source script it start working. 如果我用源脚本替换了缩小的脚本标签(我的自定义代码),它将开始工作。

Running out of ideas what could be wrong. 用尽主意可能是什么问题。

Replaced ngMin with ngAnnotate in Gruntfile.js and also added 'ngAnnotate:dist' in grunt build task. 在Gruntfile.js中将ngMin替换为ngAnnotate,并在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'
                    }
                ]
            }
        }

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM