如何使用 grunt 服务 angular 应用程序?
How to serve angular app with grunt?
我是 angular 新手,正在尝试 运行 grunt
和 angular
。我的 g运行t 文件看起来像这样,我需要添加哪个插件或模块来为 angular 应用程序提供服务?我试过 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']);
};
g运行t-contrib-watch 运行 文件更改(创建、更新等)时的任务。
要为 angular 应用提供服务,请尝试插件 "grunt-serve".
我是 angular 新手,正在尝试 运行 grunt
和 angular
。我的 g运行t 文件看起来像这样,我需要添加哪个插件或模块来为 angular 应用程序提供服务?我试过 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']);
};
g运行t-contrib-watch 运行 文件更改(创建、更新等)时的任务。 要为 angular 应用提供服务,请尝试插件 "grunt-serve".