通过查看全新安装的Magento 2(v2.1.8),我从他们的Gruntfile.js
和package.json
文件中看到Magento正在使用grunt-autoprefixer
- 太好了,CSS自动前缀确实很有用。但是我看不到如何在Magento的Gruntfile中使用它,有人知道它是如何工作的吗?
- 此外,这在实际环境中的生产模式下将如何工作?Magento2不在生产模式下使用PHP LESS编译器,而Grunt仅用于进行开发。
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",
我跑了grunt autoprefixer
,它似乎也不起作用。
$ 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
grunt autoprefixer
中止运行,并没有完成消息Autoprefixer's process() method is deprecated and will removed in next major release. Use postcss([autoprefixer]).process() instead
。哪个表明Magento根本不支持自动前缀?