I'm very new to programming and am trying to teach myself HTML and CSS3 so I apologize in advance if I don't make sense or if I don't understand what it is that's wrong with my code. The problem is that when I type in grunt watch into the terminal command line nothing happens. I've been trying to use autoprefixer(https://github.com/postcss/autoprefixer) and grunt. I followed this websites (http://css-tricks.com/autoprefixer/) instructions; however, I tried to modify the code for the grunt file slightly so that it would provide prefixes for any browser that has a market share higher than 1%.
Here is my altered gruntfile.js code.
module.exports = function (grunt) {
grunt.initConfig({
autoprefixer: {
options: {
browsers: ['>1%']
}
dist: {
files: {
'build/style.css': 'style.css'
}
}
},
watch: {
styles: {
files: ['style.css'],
tasks: ['autoprefixer']
}
}
});
grunt.loadNpmTasks('grunt-autoprefixer');
grunt.loadNpmTasks('grunt-contrib-watch');
};
and here is my package.json file
{
"name": "grunt-autoprefixer",
"version": "0.1.1",
"description": "Parse CSS and add vendor-prefixed CSS properties using the Can I Use database. Based on Autoprefixer.",
"devDependencies":{
"grunt": "~0.4.4",
"grunt-contrib-watch" : "0.6.1",
"grunt-autoprefixer" :"latest"
}
}
I know it's very similar to this question (Node.js/Grunt - Can't run Grunt's watch - why?) but the author of the question didn't state what he changed to make it work in the end. Thanks