Skip to content
This repository has been archived by the owner on Sep 25, 2020. It is now read-only.

Grunt autoprefixer is not adding prefixes #130

Open
i1kom opened this issue Apr 26, 2020 · 0 comments
Open

Grunt autoprefixer is not adding prefixes #130

i1kom opened this issue Apr 26, 2020 · 0 comments

Comments

@i1kom
Copy link

i1kom commented Apr 26, 2020

I just started using grunt and autoprefixor and faced with next issue. When i run the grunt task everything is finising sucsessfully and consol show message:

Running "postcss:dist" (postcss) task
>> 1 processed stylesheet created. 

But when i open css file i see that no one prefix was not added. I also post Grunt.js and package.json code below. Pls help me to figure out what i did wrong. Will be happy to get any advise.
Thank you in advance!

Grunt.js

module.exports = function(grunt) {
 grunt.loadNpmTasks('grunt-browser-sync');
 grunt.loadNpmTasks('grunt-contrib-less');
 grunt.loadNpmTasks('grunt-contrib-watch');
 grunt.loadNpmTasks('grunt-postcss');
 grunt.loadNpmTasks('grunt-posthtml');

 
  grunt.initConfig({
    less: {
      development: {
        options: {
          compress: true,
          yuicompress: true,
          optimization: 2
        },
        files: {
          "css/style.css": "less/style.less" 
        }
      }
    },
    postcss: {
		style: {
		  options: {
		  autoprefixer: { grid: true },
		  map: {
			inline: true,
		  },
		processors: [
			  require('autoprefixer')([
          "last 6 versions"
        ])
			]
		  }
		},
		dist: {
		    files: {
			  "css/style.css": "css/style.css"
			}
		}
    },
	watch: {
      styles: {
        files: ['less/**/*.less'], 
        tasks: ['less', 'postcss'],
        options: {
          nospawn: true,
		  livereload: false
        }
      }
    },
	browserSync: {
		bsFiles: {
			src : [
				'css/*.css',
				'*.html'
				]
		},
		options: {
			watchTask: true,
			notify: false,
			server: {
				baseDir: "./"
			}
		}
	}
});
 
	grunt.registerTask('default', ['browserSync', 'less', 'postcss', 'watch']);
};

Package.json

{
  "name": "my-super-amazing-app",
  "version": "1.0.0",
  "private": true,
   "browserslist": [
    "> 1%",
    "last 6 versions",
    "ie 6-8",
    ">= 5%",
    "ie 6-8"
  ],
  "repository": {
    "type": "git",
    "url": "git://github.com/i1kom/BarbershopExtended.git"
  },
  "devDependencies": {
    "autoprefixer": "^9.7.6",
    "grunt-autoprefixer": "^3.0.4",
    "grunt-browser-sync": "^2.2.0",
    "grunt-contrib-connect": "^2.1.0",
    "grunt-contrib-less": "^2.0.0",
    "grunt-contrib-watch": "^1.1.0",
    "grunt-postcss": "^0.9.0",
    "grunt-posthtml": "^0.5.0"
  },
  "dependencies": {
    "grunt": "^1.1.0"
  },
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1",
    "start": "node index.js"
  },
  "postcss": {
    "plugins": {
      "autoprefixer": {
        "grid": true
      }
    }
  }
}

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant