Do I need to install all these dependencies and devDependencies to use autoprefixer in node, although I do not use gulp at all?
https://github.com/postcss/autoprefixer/blob/master/package.json
I want to use it in node like this:
"scripts": {
"build:css": "autoprefixer -b 'last 2 versions' <assets/styles/main.css | cssmin > dist/main.css"
}
as described here: http://blog.keithcirkel.co.uk/how-to-use-npm-as-a-build-tool/
But I get an error saying that the system cannot find a file, don´t know which file it means.
I installed it with
npm install autoprefixer --save-dev
PostCSS plugin to parse CSS and add vendor prefixes to CSS rules using values from Can I Use. It is recommended by Google and used in Twitter and Taobao.
The devDependencies of autoprefixer are only needed if you are working on autoprefixer itself (that's why they are devDependencies).
Definition of Gulp Autoprefixer. We know that gulp is used to manage the front-end tasks of developers which mean it automates different tasks. Auto prefixer helps us to manage CSS codes; on the other hand, online auto prefixer provides the prefixed CSS codes of websites.
PostCSS was developed by Andrey Sitnik, the creator of Autoprefixer. It is a Node. js package developed as a tool to transform all of your CSS using JavaScript, thereby achieving much faster build times than other processors.
Autoprefixer doesn't run on it's own. It needs to be run as part of postcss-cli like so:
postcss --use autoprefixer *.css -d build/
(from https://github.com/postcss/autoprefixer#cli)
Save-dev postcss-cli and then reformat your build:css to match
postcss --use autoprefixer -b 'last 2 versions' <assets/styles/main.css | cssmin > dist/main.css
Then let us know if you're still having problems.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With