1
我正在爲我正在創建的一個小型項目創建以下grunt文件。然而,它與以下消息中止爲什麼Grunt文件會隨着消息中止參數path.join必須是字符串使用--force繼續
Running "sass:dev" (sass) task
Warning: Arguments to path.join must be strings Use --force to continue.
我在哪裏做錯了?有人可以向我解釋嗎?
/*!
* XXX
* @author XXXXXX
*/
'use strict';
/**
* Grunt Module
*/
module.exports = function(grunt) {
// Grunt goodness goes here
/**
* Configuration
*/
grunt.initConfig({
/**
* Get package meta data
*/
pkg: grunt.file.readJSON('package.json'),
/**
* Set project object
*/
project: {
app: 'app',
assets: '<%= project.app %>/assets',
src: '<%= project.assets %>/src',
css: [
'<%= project.src %>/styles/*.scss'
],
js: [
'<%= project.src %>/scripts/*.js'
],
dist: '<%= project.assets %>/dist',
distcss: [
'<%= project.dist %>/styles/*.scss'
],
distjs: [
'<%= project.dist %>/scripts/*.js'
],
},
/**
* Project banner
*/
tag: {
banner: '/*!\n' +
' * <%= pkg.name %>\n' +
' * <%= pkg.title %>\n' +
' * <%= pkg.url %>\n' +
' * @author <%= pkg.author %>\n' +
' * @version <%= pkg.version %>\n' +
' * Copyright <%= pkg.copyright %>. <%= pkg.license %> licensed.\n' +
' */\n'
},
/**
* Sass
*/
sass: {
dev: {
options: {
style: 'expanded',
banner: '<%= tag.banner %>',
compass: true
},
files: {
'<%= project.css %>': '<%= project.distcss %>'
}
},
dist: {
options: {
style: 'compressed',
compass: true
},
files: {
'<%= project.css %>': '<%= project.distcss %>'
}
}
},
/**
* Watch
*/
watch: {
sass: {
files: '<%= project.src %>/styles/{,*/}*.{scss,sass}',
tasks: 'sass:dev'
}
},
// Uglify
uglify: {
options: {
banner: '/*! <%= pkg.name %> Version: <%= pkg.version %> Created on: <%= grunt.template.today("yyyy-mm-dd") %> */\n'
},
build: {
src: 'src/scripts/*.js',
dest: 'build/<%= pkg.name %>.min.js'
}
}
});
/**
* Load Grunt plugins
*/
require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks);
/**
* Default task
* Run `grunt` on the command line
*/
grunt.registerTask('default', [
'sass:dev',
'watch'
]);
};