I need to make massive changes on a purchased magento 2.1.9 theme.
I created a child theme, copied the files I want to edit.
For now I can use grunt to compile .less files located in the web/css directory of my child theme but I would also like to compile some .less that are in module directories.
How to declare them in the dev/tools/grunt/configs/themes.js file?
Here my theme.js :
my-theme: {
area: 'frontend',
name: 'Vendor/theme',
locale: 'fr_FR',
files: [
'css/theme',
'css/theme_default',
'css/responsive',
'css/menu'
],
dsl: 'less'
},
Using commands grunt exec:my-theme
, grunt less:my-theme
or grunt watch:my-theme
works fine with main .less files. (theme.less, theme_default.less, responsive.less & menu.less)
Theme structure :
app/design/frontend/
|-- /
| | |--.../
| | | |--...etc/
| | | |--...Magento_Catalog/
| | | |--...
| | | |--...MGS_Megamenu/
| | | | |--...
| | | | |--...web/css/
| | | | | |--...megamenu.less
| | | | |--...
| | | |--...
| | | |--...web/css/
| | | | |--...menu.less
| | | | |--...responsive.less
| | | | |--...theme.less
| | | | |--...theme_default.less
I’d like to be able to use grunt watch:my-theme
for the megamenu.less in the Vendor/theme/MGS_Megamenu/web/css/ directory.
Thanks for your help.