Axi*_*iol 1 javascript gruntjs
我刚开始使用Grunt,我可能已经遇到了问题.所以,这就是我的Gruntfile.js样子:
module.exports = function (grunt) {
grunt.initConfig({
// Ability to access the package.json informations
pkg: grunt.file.readJSON('package.json'),
// SASS compilation
sass: {
dist: {
options: {
style: 'compressed'
},
expand: true,
cwd: './sass/',
src: 'main.scss',
dest: './css/',
ext: '.css'
},
dev: {
options: {
style: 'expanded',
debugInfo: true,
lineNumbers: true
},
expand: true,
cwd: './sass/',
src: 'main.scss',
dest: './css/',
ext: '.css'
}
}
});
};
Run Code Online (Sandbox Code Playgroud)
当我跑步时grunt sass:dev,它总会让我回归Warning: Task "sass:dev" not found. Use --force to continue.
当我开始使用它时,我看了一下doc并找不到我可能出错的地方......是的,依赖项已正确安装.
您需要确保在initConfig部分之后注册任务.
module.exports = function (grunt) {
grunt.initConfig({
// ...
});
grunt.loadNpmTasks('grunt-contrib-sass');
};
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1714 次 |
| 最近记录: |