简体   繁体   English

如何为grunt提供角度的应用程序?

[英]How to serve angular app with grunt?

I am an angular newbie and trying to run grunt with angular . 我是一名棱角分明的新手,并试图与angular grunt My grunt file looks like this, which plugin or module do I need to add to serve an angular app? 我的grunt文件看起来像这样,我需要添加哪个插件或模块才能提供有角度的应用程序? I tried grunt-contrib-watch : 我尝试了grunt-contrib-watch

module.exports = function(grunt) {

    grunt.initConfig({

        pkg: grunt.file.readJSON('package.json'),
        sassFiles: 'app/**/*.scss',

        sass: {
            dist: {
                files: {
                    'build/site.css': 'app/site.scss'
                }
            }
        },

        watch: {
            sass: {
                tasks: ['sass'],
                files: 'app/**/*.scss'
            }

        },
        another: {
            files: ['app/*.js'],
            tasks: ['anothertask'],
            options: {
                // Start another live reload server on port 1337
                livereload: 1337
            }
        }
    });


    grunt.loadNpmTasks('grunt-contrib-watch');
    grunt.loadNpmTasks('grunt-sass');


    grunt.registerTask('dev', ['default', 'watch','another']);
    grunt.registerTask('default', ['sass']);

};

grunt-contrib-watch run a task when files change (created,updated, etc..). grunt-contrib-watch在文件更改(创建,更新等)时运行任务。 To serve an angular app , try the plugin "grunt-serve". 要提供有角度的应用程序,请尝试使用“ grunt-serve”插件。

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

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