Как включить исходные карты CSS для Magento 2


Как включить исходные карты CSS для интерфейсного рабочего процесса Magento 2.

Я изучаю M2 и создал пользовательскую тему под названием "мифема", унаследованную от готовой темы luma. Я бы хотел использовать исходные карты для навигации по лабиринту меньшего количества файлов.

Мой локальный сервер разработки компилирует МЕНЬШЕ файлов, но я также настроил grunt для компиляции МЕНЬШЕГО КОЛИЧЕСТВА. Я также проверил, что dev/tools/grunt/configs/less.js имеет sourceMap: true,.

Как вы можете видеть из вывод консоли ниже, я очистил кэш, запустил процесс grunt watch, но по-прежнему не была создана исходная карта CSS. Я что-то упускаю?

magento2$ php bin/magento cache:clean; php bin/magento cache:flush; rm -rf pub/static/frontend/Holy/mytheme/en_IE/ ; rm -rf var/view_pre
processed/
Cleaned cache types:
config
layout
block_html
collections
reflection
db_ddl
eav
customer_notification
full_page
config_integration
config_integration_api
translate
config_webservice
Flushed cache types:
config
layout
block_html
collections
reflection
db_ddl
eav
customer_notification
full_page
config_integration
config_integration_api
translate
config_webservice
magento2$ php bin/magento cache:clean; php bin/magento cache:flush; rm -rf pub/static/frontend/Holy/mytheme/en_IE/ ; rm -rf var/view_preprocessed/
Cleaned cache types:
config
layout
block_html
collections
reflection
db_ddl
eav
customer_notification
full_page
config_integration
config_integration_api
translate
config_webservice
Flushed cache types:
config
layout
block_html
collections
reflection
db_ddl
eav
customer_notification
full_page
config_integration
config_integration_api
translate
config_webservice

Тогда...

magento2$ grunt watch
Running "watch" task
Waiting...
>> File "pub/static/frontend/Holy/mytheme/en_US/css/source/_extend.less" changed.
Running "less:mytheme" (less) task
File pub/static/frontend/Holy/mytheme/en_US/css/styles-m.css created: 333.74 kB → 574.02 kB
File pub/static/frontend/Holy/mytheme/en_US/css/styles-l.css created: 80.3 kB → 138.41 kB

Done, without errors.


Execution Time (2017-03-22 22:29:06 UTC-0)
loading tasks                3.3s  ▇▇▇▇▇▇▇▇▇▇ 7%
loading grunt-contrib-less  985ms  ▇▇▇ 2%
less:mytheme                   43.7s  ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 91%
Total 48s

Completed in 51.030s at Wed Mar 22 2017 22:29:54 GMT+0000 (UTC) - Waiting...
^C

Execution Time (2017-03-22 22:28:52 UTC-0)
Total 1m 32.7s

Тогда...

magento2$ find . -type f -name "*css.map"
./node_modules/convert-source-map/test/fixtures/map-file-comment.css.map
magento2$ 
Author: Holly, 2017-03-22

1 answers

Хорошо, поэтому я вернулся к этому и заставил его работать, проблема заключалась в том, что у меня был рабочий процесс интерфейсной разработки, настроенный на компиляцию на стороне клиента, который переопределял файлы CSS, созданные Grunt и с использованием less.js вместо этого библиотека.

 3
Author: Holly, 2017-06-13 05:19:49