У меня есть Gruntfile
, написанный в CoffeeScript
, и я продолжаю получать (Error code: EISDIR)
, когда запускается задача cssmin
. После выполнения задачи в подробном режиме я получаю следующую информацию:
Running "cssmin" task
Running "cssmin:src" (cssmin) task
Verifying property cssmin.src exists in config...OK
Files: assets/z.styles.concat.css.liquid -> src
Options: report=false
Reading assets/z.styles.concat.css.liquid...OK
Writing src...ERROR
Warning: Unable to write "src" file (Error code: EISDIR). Use --force to continue.
Здесь моя задача cssmin:
cssmin:
src: 'assets/z.styles.concat.css.liquid'
dest: 'assets/styles.min.css.liquid'
z.styles.concat.css.liquid
создается после запуска concat
и успешно выводится в папку активов. Путь, указанный в атрибуте src, правильный.
Любая идея, что может быть причиной ошибки?
Кроме того, вот весь файл grunt для попустительности.
Grunt.coffee:
module.exports = (grunt) ->
# Project configuration.
grunt.initConfig
pkg: grunt.file.readJSON 'package.json'
files:
grunt: ['gruntfile.js']
css: ['assets/screen.css', 'assets/styles.css.liquid']
scss: ['src/scss/**/*.scss']
js: ['src/js/**/*.js'] #(if we need liquid templating), 'src/js/**/*.js.liquid', 'assets/**/*.js.liquid']
coffee: ['src/js/coffee/**/*.coffee', 'src/js/coffee/**/*.coffee.liquid']
img: ['src/images/**/*.{png,jpeg,svg,jpg,gif}']
# Image Processing
smushit:
path:
src: '<%= files.img %>' #recursively replace minified images
dest: 'assets'
# Concatenation Processing
concat:
css:
src: ['<%= files.css %>']
dest: 'assets/z.styles.concat.css.liquid'
js:
src: ['<%= files.js %>']
dest: 'src/js/z.scripts.concat.js'
# JavaScript Processing
coffee:
app:
expand: true
cwd: 'src/js/coffee'
src: ['**/*.coffee', '**/*.coffee.liquid']
dest: 'src/js'
ext: '.js'
uglify:
dist:
src: ['src/js/z.scripts.concat.js']
dest: 'assets/scripts.min.js'
jshint:
files: ['<%= files.grunt %>', 'src/js/z.scripts.concat.js']
options:
jquery: true
smarttabs: true
curly: true
eqeqeq: true
immed: true
latedef: true
newcap: true
noarg: true
sub: true
undef: true
boss: true
eqnull: true
browser: true
globals:
jQuery: true
console: true
undef: true
unused: false
# CSS Processing
compass:
dist:
options:
sassDir: 'src/scss'
cssDir: 'assets'
imagesDir: 'assets',
javascriptsDir: 'assets',
outputStyle: 'expanded'
cssmin:
src: 'assets/z.styles.concat.css.liquid'
dest: 'assets/styles.min.css.liquid'
# watch tasks
watch:
options:
nospawn: true
events: ['changed', 'added']
files: [
'<%= files.js %>'
'<%= files.coffee %>'
'<%= files.scss %>'
]
tasks: ['default']
# These plugins provide necessary tasks.
grunt.loadNpmTasks 'grunt-contrib-coffee'
grunt.loadNpmTasks 'grunt-contrib-watch'
grunt.loadNpmTasks 'grunt-contrib-concat'
grunt.loadNpmTasks 'grunt-contrib-jshint'
grunt.loadNpmTasks 'grunt-contrib-uglify'
grunt.loadNpmTasks 'grunt-contrib-cssmin'
grunt.loadNpmTasks 'grunt-smushit'
grunt.loadNpmTasks 'grunt-contrib-compass'
# Default task.
grunt.registerTask 'default', [
'coffee'
'concat:js'
'jshint'
'uglify'
'concat:css',
'cssmin'
]
# Minify task
# Run the default task then losslessly minify images with Yahoo! Smush-It
grunt.registerTask 'minify', ['default', 'smushit']