Bruce Santos
Bruce Santos

Reputation: 73

Using Grunt for Sass and Autoprefixer. Need help to set up my config file

I'm trying to setup my gruntconfig.js and while the tasks are running without errors on terminal, Autoprefixer and Grunt's Watch are not working at all. Am I doing something wrong? BTW can I run Saas and Autoprefixer together?

module.exports = function(grunt) {

// configures task(s)
grunt.initConfig({
    pkg: grunt.file.readJSON('package.json'),

sass: {
  dist: {
    options: {
      outputStyle: 'expanded'
    },
    files: {
      'css/style.css' : 'src/scss/main.scss.css'
    }
  }
},

watch: {
    css: {
      files: 'src/scss/main.scss.css',
      tasks: ['sass', 'autoprefixer']
    }
},

    autoprefixer: {
  files: {
    'css/style.css': 'src/scss/main.scss.css'
  }
}

});

// Load the Plugins
grunt.loadNpmTasks('grunt-autoprefixer');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-sass');


// Register Task(s)
grunt.registerTask('default', ['autoprefixer', 'sass'] );

};

And here's my directory structure

assets

css
    style.css
    normalize.css

fonts

gruntfile.js

img

index.html

js

node_modules

package.json

src
    design
    js
    scss
        main.scss

It's my 1st time doing this.

Upvotes: 0

Views: 85

Answers (1)

Bruce Santos
Bruce Santos

Reputation: 73

Never mind. I started using Codekit. Waaaay better!

Upvotes: 1

Related Questions