How to run grunt server in dist directory instead of app directory?

前端 未结 4 1000
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-13 18:26

After grunt building my AngularJS app to my dist directory, I would like to test it out with grunt server. Problem is that grunt

4条回答
  •  醉酒成梦
    2020-12-13 18:55

    The very short answer is

    grunt serve:dist
    

    That works with my yeoman-generated Gruntfile.js which contains:

      grunt.registerTask('serve', function (target) {
        if (target === 'dist') {
          return grunt.task.run(['build', 'connect:dist:keepalive']);
        }
    
        grunt.task.run([
          'clean:server',
          'bower-install',
          'concurrent:server',
          'autoprefixer',
          'connect:livereload',
          'watch'
        ]);
      });
    

提交回复
热议问题