【发布时间】:2015-09-14 05:00:03
【问题描述】:
期待 Sassier Bootstrap 4,我(试图)在 Bootstrap 3.3.5 和 setting up the required Gruntfile.js 文件上从 Less 切换到 Sass。我在编译 Less 时没有问题,但无法让 Grunt 与 Sass 一起工作,具体来说,$ grunt 和 $ grunt watch 都可以帮助我
Running "watch" task
Waiting...
永远。
不用说它不编译。我试过$ grunt watch --verbose,得到了很多绿色OKs。
我认为我的gruntfile.js 中有一些错误或效率低下,但由于这是 Baby 的第一个 Gruntfile.js,所以我被困在了这里。你能看出是什么原因造成的吗?
/*** Created by morgan on 9/13/15. */
module.exports = function (grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
sass: {
dev: {
options: {
includePaths: ['static/sass']
},
dev: {
options: {
style: 'expanded',
compass: false
},
files: {
'css/styles.css': 'sass/styles.scss'
}
}
}
},
watch: {
grunt: { files: ['Gruntfile.js'] },
sass: {
files: [
'sass/**/*.scss'
],
tasks: ['sass:dev']
}
}
});
grunt.loadNpmTasks('grunt-contrib-sass');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.registerTask('default', 'watch')
};
我的项目目录,如果有帮助的话:
(Django project)
app
├── static
│ ├── sass
│ │ ├── _bootstrap.scss
│ │ └── styles.scss
│ ├── css
│ │ └── styles.css
│ └── jquery
├── node_modules
│ ├── grunt
│ ├── grunt-contrib-sass
│ └── grunt-contrib-watch
├── Gruntfile.js
└── package.json
【问题讨论】:
标签: gruntjs grunt-contrib-watch bootstrap-sass gruntfile