I have a custom theme Mycompany/mytheme
including <Magento>/<blank>
as parent.
The locale is set to de_DE.
When I execute php bin/magento setup:static-content:deploy de_DE
everything works fine, my custom-m.less
and custom-l.less
get compiled into custom-m.css
and custom-l.css
and I also get the Magento/blank theme files and viewing the magento website with chrome also loads these files.
custom-m.less and custom-l.less are exact copies from the blank themes styles-m and styles-l less files
The Problem:
Using grunt exec:mytheme
and grunt less:mytheme
kinda behaves strange. I still load the Magento/blank styles-l.css but everything else gets loaded via their own less component files (e.g. _extend.less or _module.less)
Here is my grunt config file:
magento-root/dev/tools/grunt/configs/themes.js
module.exports = {
-----------------------------
... blank and luma stuff here
-----------------------------
mytheme: {
area: 'frontend',
name: 'Mycompany/mytheme',
locale: 'de_DE',
files: [
'css/styles-m',
'css/styles-l',
'css/email',
'css/email-inline',
'css/custom-m',
'css/custom-l'
],
dsl: 'less'
},
--------------------------
... backend stuff here ...
--------------------------
};
'css/styles-m', 'css/styles-l', 'css/email', 'css/email-inline' are not inside my mytheme, but as magento devdocs says should anyways be included because of the parent theme inheriting. I also tried to not include these files inside the config file = Same result
BTW: grunt commands throw no errors, seems to work fine, in var/view_preprocessed I see my custom files inside the Mycompany/mytheme folders, same as pub/static/frontend....
I deleted the cache after each new try
Server-side compilation enabled
developer mode enabled
Question: Can someone help me with this? Can someone explain whats wrong?
And what is the expected workflow? Magento Documentation is a bit unclear about that
- php bin/magento setup:static-content:deploy -> grunt watch ?
- php bin/magento setup:static-content:deploy -> grunt exec:mytheme -> grunt watch ?
- grunt exec:mytheme -> grunt watch ?
Should I use the magento php compiler at all? Because I don't want to, way too slow
php bin/magento setup:static-content deploy
works fine. When I use grunt I get this strange behavior, as described above