Good morning,
I'm pretty new to Magento 2 and I'm currently in the process of trying to get my first custom M2 theme up and running.
I have managed to create my new theme but running into trouble when trying to get the Grunt LESS task running.
I have been following the Magento docs and do the following...
- added in the package.json, Gruntfile.js, and grunt-config.json files
- ran npm install && npm update
- I've then proceeded to add a local-themes.js file and update it to contain the following...
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
'use strict';
/**
* Define Themes
*
* area: area, one of (frontend|adminhtml|doc),
* name: theme name in format Vendor/theme-name,
* locale: locale,
* files: [
* 'css/styles-m',
* 'css/styles-l'
* ],
* dsl: dynamic stylesheet language (less|sass)
*
*/
module.exports = {
blank: {
area: 'frontend',
name: 'Magento/blank',
locale: 'en_US',
files: [
'css/styles-m',
'css/styles-l',
'css/email',
'css/email-inline'
],
dsl: 'less'
},
luma: {
area: 'frontend',
name: 'Magento/luma',
locale: 'en_US',
files: [
'css/styles-m',
'css/styles-l'
],
dsl: 'less'
},
alpha: {
area: 'frontend',
name: 'SC/alpha',
locale: 'en_GB',
files: [
'css/styles-m',
'css/styles-l'
],
dsl: 'less'
},
backend: {
area: 'adminhtml',
name: 'Magento/backend',
locale: 'en_US',
files: [
'css/styles-old',
'css/styles'
],
dsl: 'less'
}
};
My grunt-config.json
is as follows...
{
"themes": "dev/tools/grunt/configs/local-themes"
}
- Then when I try running the grunt exec:alpha command I get the following error...
Running "exec:alpha" (exec) task
Verifying property exec.alpha exists in config...ERROR
>> Unable to process task.
Warning: Required config property "exec.alpha" missing. Use --force to continue.
Aborted due to warnings.
Running the grunt exec
command by itself references the blank and luma themes but not my custom theme.
Really not sure on how to proceed with this, has anyone else encountered this problem before?
Any help on this would be greatly appreciated.