Closed AntonioAsr closed 5 years ago
Just had the same error: It looks fairly simple – the copy:styles target no longer exists! Here's a snippet showing the copy task from a much old webapp generated gruntfile, compare it with yours and note how the styles target has been removed from copy task:
// Copies remaining files to places other tasks can use
copy: {
dist: {
files: [{
expand: true,
dot: true,
cwd: '<%= config.app %>',
dest: '<%= config.dist %>',
src: [
'*.{ico,png,txt}',
'images/{,*/}*.webp',
'{,*/}*.html',
'styles/fonts/{,*/}*.*',
'styles/icons/{,*/}*.*',
'files/{,*/}*.*'
]
}, {
expand: true,
dot: true,
cwd: '.',
src: 'bower_components/bootstrap-sass-official/assets/fonts/bootstrap/*',
dest: '<%= config.dist %>'
}]
},
styles: {
expand: true,
dot: true,
cwd: '<%= config.app %>/styles',
dest: '.tmp/styles/',
src: '{,*/}*.css'
}
},
The styles task is only added if you choose NOT to install SASS, I suppose the assumption would be that if you're using SASS then you'll have .scss files not .css in app. So this bug only appears if you add .css files. And it only occurs in the watch task (so the bug doesn't appear unless you modify the css files). The simple workaround is to rename any .css files to .scss.
Perhaps the watch:styles target needs to be removed if SASS is installed at generate time, I don't see where else that's used.
Closing as this repo is deprecated.
Hello everyone, I keep getting this error with the default config of gruntfile when I run the command grunt serve:dist Npm version is: 2.11.0 Node version: v5.1.0.
Running "newer:copy:styles" (newer) task Warning: Cannot read property 'files' of undefined Use --force to continue.
This is my gruntfile.js file configuration:
Thank you!