From looking at a fresh install of Magento 2 (v2.1.8) I see from their Gruntfile.js
and package.json
files that Magento is using grunt-autoprefixer
- This is great, CSS autoprefixers are really useful. But I can't see how to use it with Magento's Gruntfile, does anyone have an idea how it works?
- Also, how would this work in production mode on a live environment? Doesn't Magento2 use use a PHP LESS compiler in production mode, while Grunt is just used for developing with.
Gruntfile.js
/**
* Production preparation task.
*/
prod: function (component) {
var tasks = [
'less',
'autoprefixer',
'cssmin',
'usebanner'
]
package.json
"devDependencies": {
"glob": "^5.0.14",
"grunt": "^0.4.5",
"grunt-autoprefixer": "^2.0.0",
I ran grunt autoprefixer
and it does not seem to work either.
$ grunt autoprefixer
Running "autoprefixer:setup" (autoprefixer) task
Autoprefixer's process() method is deprecated and will removed in next major release. Use postcss([autoprefixer]).process() instead
File setup/pub/styles/setup.css created.
Running "autoprefixer:updater" (autoprefixer) task
Warning: No source files were found. Use --force to continue.
Aborted due to warnings.
Execution Time (2017-10-29 11:12:01 UTC-0)
loading tasks 145ms ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 30%
loading grunt-autoprefixer 118ms ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 24%
autoprefixer:setup 216ms ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 45%
autoprefixer:updater 5ms ▇▇ 1%
Total 485ms