2
我是一个角度新手,试图运行grunt
与angular
。我的咕噜文件看起来像这样,我需要添加哪个插件或模块来提供角度应用程序?我试图grunt-contrib-watch
:如何使用grunt为角应用程序提供服务?
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']);
};
好吧,只是想知道是否可以使用npm而不使用gruntplugin? –
Npm只是一个安装grunt及其插件(或其他)的软件包管理器。 但是如果你想用Node.js创建一个web服务器,你可以在这里解释它:http://stackoverflow.com/a/8427954/5368495 – Charles