我遇到了 Grunt 的 grunt-contrib-sass
包的问题,我只是忽略了。当它编译我的 sass 时,我希望它进入我的 css 目录,而不是在 css 目录中创建 sass 目录。这是 grunt-contrib-sass
编译后我现在拥有的。我不希望它在编译时将 sass
目录添加到 css
目录中:
- css
- sass (I don't want this level)
- default
- index.css
- sass
- default
- index.scss
- fonts.scss
- Gruntfile.js
- grunt
- watch.js
- sass.js
Gruntfile.js
module.exports = function(grunt) {
var options = {
config: {
src: './grunt/*.js'
},
pkg: grunt.file.readJSON('package.json')
};
var config = require('load-grunt-config')(grunt, options);
grunt.initConfig(config);
grunt.registerTask('default', ['watch']);
};
萨斯.js
module.exports = {
skins: {
options: {
style: 'compressed'
},
files: [{
expand: true,
src: ["sass/**/index.scss"],
dest: "css/",
ext: '.css'
}]
}
};
watch.js
module.exports = {
sass: {
files: [
'sass/**/*.scss',
],
tasks: ['sass'],
options: {
livereload: true
}
}
};
最佳答案
尝试使用 sass.js
。
module.exports = {
skins: {
options: {
style: 'compressed'
},
files: [{
expand: true,
cwd: 'sass/default',
src: 'index.scss',
dest: 'css/',
ext: '.css'
}]
}
};
关于javascript - grunt-contrib-sass 问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34596957/