学习grunt.js和我一直在终端中得到这个错误。
运行"sass:dist“(sass)任务警告:路径必须是字符串。收到未确定的使用--继续使用武力。
由于警告而中止。
这是密码。任何帮助都是很好的
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
/** Sass task **/
sass: {
dev: {
options: {
style: 'expanded',
sourcemap: 'none',
},
files: {
'compiled/style.css': 'sass/style.scss'
}
},
dist: {
options: {
style: 'compressed',
sourcemap: 'none',
},
files: {
'compiled/style-min.css': 'sass/style-min.scss'
}
}
},
/** Watch task **/
watch: {
css: {
files: '**/*.scss',
tasks: ['sass']
}
}
});
grunt.loadNpmTasks('grunt-contrib-sass');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.registerTask('default', ['watch']);
}在这里我的儿子
{
"name": "millervolpe2016",
"version": "1.0.0",
"description": "Our company's new theme",
"main": "index.php",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "git+https://github.com/jspraguemillervolpe/miller-volpe.git"
},
"keywords": [
"miller",
"volpe"
],
"author": "Jason Sprague",
"license": "ISC",
"bugs": {
"url": "https://github.com/jspraguemillervolpe/miller-volpe/issues"
},
"homepage": "https://github.com/jspraguemillervolpe/miller-volpe#readme",
"devDependencies": {
"grunt": "^1.0.1",
"grunt-autoprefixer": "^3.0.4",
"grunt-contrib-sass": "^1.0.0",
"grunt-contrib-watch": "^1.0.0"
},
"dependencies": {}
}发布于 2016-06-10 08:41:27
你的sass dist:和文件:应该是这样的:
files: {
'compiled/style-min.css': 'sass/style.scss'
}您所指向的文件是sass/style.scss,因此您应该对dist和dev使用相同的文件。
这个文件:'sass/style-min.scss'不存在于您的项目和您正在使用的开发程序中:'sass/style.scss',我在这里做了一个测试,现在如果您更改它,sass:dist可以正常工作。
如果这能解决你的问题请告诉我。
谢谢。
https://stackoverflow.com/questions/37735874
复制相似问题