我的应用程序与grunt服务正常工作,但是当我用grunt服务器测试时:dist它会抛出404错误

时间:2017-09-18 07:25:06

标签: angularjs gruntjs yeoman

当我使用咕噜声测试时,我的角度应用程序可以正常使用grunt服务:dist它会抛出错误。(特别是网址)

我已打开网址,此网址正常运行。

在grunt发送后:dist网址无效,导致404错误。

除了使用grunt的url总应用程序服务:dist。

提前致谢

grunt.registerTask('serve', 'Compile then start a connect web server', function (target) {
    if (target === 'dist') {
      return grunt.task.run(['build', 'connect:dist:keepalive']);
    }

    grunt.task.run([
      'clean:server',
      'wiredep',
      'concurrent:server',
      'autoprefixer:server',
      'connect:livereload',
      'watch'
    ]);
  });

  grunt.registerTask('server', 'DEPRECATED TASK. Use the "serve" task instead', function (target) {
    grunt.log.warn('The `server` task has been deprecated. Use `grunt serve` to start a server.');
    grunt.task.run(['serve:' + target]);
  });

  grunt.registerTask('test', [
    'clean:server',
    'wiredep',
    'concurrent:test',
    'autoprefixer',
    'connect:test',
    'karma'
  ]);

  grunt.registerTask('build', [
    'clean:dist',
    'wiredep',
    'useminPrepare',
    'concurrent:dist',
    'autoprefixer',
    'concat',
    'ngAnnotate',
    'copy:dist',
    'cdnify',
    'cssmin',
    'uglify',
    'filerev',
    'usemin',
    'htmlmin',
    'copy:images',
    'copy:ngAutocompleteScript',
    'copy:languages',
    'copy:resources'
  ]);

  grunt.registerTask('default', [
    'newer:jshint',
    'test',
    'build'
  ]);

0 个答案:

没有答案