Pregunta

i am using Grunt to watch my set of sass files and compile to css when they change using the grunt-contrib-sass plugin. I have sourcemap set to true as i find this functionality really useful in css debugging.

However i am getting the following error message:

Running "sass:uk" (sass) task
WARNING: Couldn't determine public URL for "C:\Ruby193\lib\ruby\gems\1.9.1\gems\compass-core-1.0.0.alpha.19\stylesheets\compass\reset\_utilities.scss" while generating sourcemap.
  Without a public URL, there's nothing for the source map to link to.

Any ideas why this is occurring?

Here is my Gruntfile:

module.exports = function(grunt) {

grunt.initConfig({
    pkg: grunt.file.readJSON('package.json'),
    watch: {
        files: ['./style/v4/sass/**/*.scss'],
        tasks: ['sass:uk'],
        options: {
            spawn: false,
        },
    },
    sass: {
        uk: {
            options: {
                style: 'compressed',
                sourcemap: true,
                compass: true
            },
            files: {'./style/v4/css/screen.css': './style/v4/sass/screen.scss'}
        }
    }
});

grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-sass');

grunt.registerTask('default', ['watch']);

};

Thanks

¿Fue útil?

Solución

I figured out what was causing this issue. My ruby/compass/sass installation was on the c: drive of my PC whereas the sass files i was trying to compile were on the e: drive. Sass has to be installed on the same drive as the files you are compiling. When i re-installed ruby/sass/compass on e: drive it worked fine.

Otros consejos

Update grunt-contrib-sass to make it work with recent Sass versions. More info: https://github.com/gruntjs/grunt-contrib-sass/issues/25

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top