在 运行 grunt 之后,Compass 找不到任何要编译的 sass 文件
Compass can't find any sass files to compile after running grunt
我正在尝试 运行 compass
编译我的 .scss
文件。我收到以下错误:
Running "compass:dist" (compass) task
Compass can't find any Sass files to compile.
Is your compass configuration correct?.
If you're trying to start a new project, you have left off the directory argument.
Run "compass -h" to get help.
Running "watch" task
Waiting...
我的 .scss
文件存储在 /myproject/sass/
和 /myproject/sass/bootstrap/
我期待 .scss
文件被编译成缩小的 style.css
文件。
我需要做什么来排序?
compass: {
dist: {
options: {
sassDir: 'sass',
cssDir: 'css'
}
}
},
watch: {
css: {
files: '**/*.scss',
tasks: ['compass']
}
}
});
grunt.loadNpmTasks('grunt-contrib-compass');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-minified');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-cssmin');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.registerTask('default',['concat', 'minified', 'uglify', 'compass', 'watch']);
这可能值得一试:
watch: {
sass: {
files: '/sass/**/*.scss',
tasks: ['default']
},
},
我通过添加此代码修复了它:
compass: {
compile: {
options: {
cssDir: 'css'
}
}
},
这会编译 css(不缩小)。我还更改了文件和目录的其他几个值,所以我的 grunt 文件现在看起来像这样:
compass: {
dist: {
options: {
sassDir: ['sass/**/*.scss', 'sass/*.scss'],
cssDir: 'css/style.css'
}
}
},
compass: {
compile: {
options: {
cssDir: 'css'
}
}
},
watch: {
css: {
files: ['sass/style.scss'],
tasks: ['compass']
}
}
我正在尝试 运行 compass
编译我的 .scss
文件。我收到以下错误:
Running "compass:dist" (compass) task
Compass can't find any Sass files to compile.
Is your compass configuration correct?.
If you're trying to start a new project, you have left off the directory argument.
Run "compass -h" to get help.
Running "watch" task
Waiting...
我的 .scss
文件存储在 /myproject/sass/
和 /myproject/sass/bootstrap/
我期待 .scss
文件被编译成缩小的 style.css
文件。
我需要做什么来排序?
compass: {
dist: {
options: {
sassDir: 'sass',
cssDir: 'css'
}
}
},
watch: {
css: {
files: '**/*.scss',
tasks: ['compass']
}
}
});
grunt.loadNpmTasks('grunt-contrib-compass');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-minified');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-cssmin');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.registerTask('default',['concat', 'minified', 'uglify', 'compass', 'watch']);
这可能值得一试:
watch: {
sass: {
files: '/sass/**/*.scss',
tasks: ['default']
},
},
我通过添加此代码修复了它:
compass: {
compile: {
options: {
cssDir: 'css'
}
}
},
这会编译 css(不缩小)。我还更改了文件和目录的其他几个值,所以我的 grunt 文件现在看起来像这样:
compass: {
dist: {
options: {
sassDir: ['sass/**/*.scss', 'sass/*.scss'],
cssDir: 'css/style.css'
}
}
},
compass: {
compile: {
options: {
cssDir: 'css'
}
}
},
watch: {
css: {
files: ['sass/style.scss'],
tasks: ['compass']
}
}