How to configure the theme to use Grunt?












3














I normally change the file /dev/tools/grunt/configs/themes.js but in the .gitignore we can see a configuration file called /dev/tools/grunt/configs/local-themes.js I'd like to use that file instand a core file.



I try to find something related in the DevDocs, but there's nothing about this new file.



How can I configure my theme using the file /dev/tools/grunt/configs/local-themes.js?




I don't want to create a new Grunt file or to change the core, like this questions below!




Magento 2 add new theme without changing core files. Grunt










share|improve this question





























    3














    I normally change the file /dev/tools/grunt/configs/themes.js but in the .gitignore we can see a configuration file called /dev/tools/grunt/configs/local-themes.js I'd like to use that file instand a core file.



    I try to find something related in the DevDocs, but there's nothing about this new file.



    How can I configure my theme using the file /dev/tools/grunt/configs/local-themes.js?




    I don't want to create a new Grunt file or to change the core, like this questions below!




    Magento 2 add new theme without changing core files. Grunt










    share|improve this question



























      3












      3








      3


      2





      I normally change the file /dev/tools/grunt/configs/themes.js but in the .gitignore we can see a configuration file called /dev/tools/grunt/configs/local-themes.js I'd like to use that file instand a core file.



      I try to find something related in the DevDocs, but there's nothing about this new file.



      How can I configure my theme using the file /dev/tools/grunt/configs/local-themes.js?




      I don't want to create a new Grunt file or to change the core, like this questions below!




      Magento 2 add new theme without changing core files. Grunt










      share|improve this question















      I normally change the file /dev/tools/grunt/configs/themes.js but in the .gitignore we can see a configuration file called /dev/tools/grunt/configs/local-themes.js I'd like to use that file instand a core file.



      I try to find something related in the DevDocs, but there's nothing about this new file.



      How can I configure my theme using the file /dev/tools/grunt/configs/local-themes.js?




      I don't want to create a new Grunt file or to change the core, like this questions below!




      Magento 2 add new theme without changing core files. Grunt







      magento2 frontend less grunt






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited May 31 '17 at 22:47







      Rafael Corrêa Gomes

















      asked May 31 '17 at 22:42









      Rafael Corrêa GomesRafael Corrêa Gomes

      4,24722962




      4,24722962






















          3 Answers
          3






          active

          oldest

          votes


















          6














          Set up Grunt Environment



          When the installation is finished, the next step is to setup the Grunt environment. All described steps are covered in the official Magento 2 documentation, although there it’s not as compactly summarised as it is here.



          First of all, we need node.js for our stack.



          Then we can install the Grunt CLI




          npm install -g grunt-cli




          followed by the initialization of the project specific dependencies




          cd && npm install




          To test if everything is correctly installed, use the following call:



          $ grunt
          Running "default" task

          I'm the default task and at the moment I'm empty, sorry :/

          Done, without errors.


          Execution Time (2016-02-01 08:54:44 UTC)
          loading tasks 393ms ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 98%
          default 5ms ▇▇ 1%
          Total 400ms


          Create Theme Files and use them in Magento 2



          In Magento 2, themes are stored in the file system in the following pattern:



          app/design/frontend///



          For a minimal setup, we create a theme which inherits everything from Luma. So we create the following files:




          /',
          DIR );



          //theme.xml -->
          Vendor: Theme Name
          Magento/luma




          Two trivia we want to change right now, so that we can see right away that we no longer use the original Luma theme:




          // app/design/frontend///web/css/source/_theme.less
          @navigation__background: @color-blue1;
          @navigation-desktop-level0-item__color: @color-white;




          Then we select the theme in Magento 2’s backend:



          Stores > Configuration > Design > Design Theme



          Start the Frontend Workflow with Grunt



          Before we can really get to work, we need to tell Grunt that we have just created a new theme. And here is the file entry that does the trick:




          // dev/tools/grunt/configs/themes.js // Add following to config array:
          : {
          area: 'frontend',
          name: 'Vendor/Theme',
          locale: 'de_DE',
          files: [
          'css/styles-m',
          'css/styles-l'
          ],
          dsl: 'less'
          }




          Afterward, the following steps should be executed exactly once before starting to work:



          Clean static files and caches:




          grunt clean




          Collect resources and generate static files for our theme:




          grunt exec:




          Initialize the preprocessing:




          grunt less:




          Afterward, reload the frontend page!
          The first-page view might lead to excessively long load times since Magento 2 starts the preprocessing in the background which means that a great number of files need to be processed.



          Voilà! We have successfully changed Magento’s background color and font color in the menu using our own workflow.
          From now on, we can start the watch task:




          grunt watch




          If we change a LESS file, Grunt will automatically update all necessary files so we only have to reload the frontend (with the LiveReload browser plugin installed, you won’t even need to do that manually).



          Trouble Shooting



          Changing Files



          In some cases (e.g. adding new files) it might be necessary to initialize everything again:




          grunt clean



          grunt exec:



          grunt less:




          General “unidentified” problems



          The following checklist should reset the system and make changes visible:



          Delete the static files relevant for the theme in:
          pub/static/frontend/
          var/view_preprocessed/less/
          var/view_preprocessed/source/
          Delete the Magento caches (Backend, bin/magento CLI or n98-magerun2)
          bin/magento setup:static-content:deploy <lang_LANG>
          Start Grunt workflow





          share|improve this answer























          • I had specified that I don't want to change the core file dev/tools/grunt/configs/themes.js
            – Rafael Corrêa Gomes
            Aug 2 '17 at 1:56



















          1














          You can use below code to configure you custom theme for grunt in theme.js file:



          blue: {
          area: 'frontend',
          name: 'Colors/blue',
          locale: 'en_US',
          files: [
          'css/styles-m',
          'css/styles-l',
          'css/my'
          ],
          dsl: 'less'
          },


          Above cofiguration as per my theme path : appdesignfrontendColorsblue, You have to change as per your vendor(Colors) and theme name(blue),



          And run command:



          grunt exec:blue  
          grunt less:blue
          grunt watch





          share|improve this answer





















          • Where do I need to create the theme.js?
            – Rafael Corrêa Gomes
            Aug 2 '17 at 1:54










          • You do not have to create theme.js file, you can find this file at <root>devtoolsgruntconfigs.
            – Dipesh Rangani
            Aug 2 '17 at 5:01










          • So, I described that I don't want to change a core file.
            – Rafael Corrêa Gomes
            Aug 2 '17 at 19:19



















          1














          You can copy file /dev/tools/grunt/configs/themes.js to /dev/tools/grunt/configs/local-themes.js



          Then edit Gruntfile.js file in your magento root folder :



          At line 19, change dev/tools/grunt/configs/themes to dev/tools/grunt/configs/local-themes



          Hope that helps.






          share|improve this answer





















            Your Answer








            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "479"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: false,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f176892%2fhow-to-configure-the-theme-to-use-grunt%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            3 Answers
            3






            active

            oldest

            votes








            3 Answers
            3






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            6














            Set up Grunt Environment



            When the installation is finished, the next step is to setup the Grunt environment. All described steps are covered in the official Magento 2 documentation, although there it’s not as compactly summarised as it is here.



            First of all, we need node.js for our stack.



            Then we can install the Grunt CLI




            npm install -g grunt-cli




            followed by the initialization of the project specific dependencies




            cd && npm install




            To test if everything is correctly installed, use the following call:



            $ grunt
            Running "default" task

            I'm the default task and at the moment I'm empty, sorry :/

            Done, without errors.


            Execution Time (2016-02-01 08:54:44 UTC)
            loading tasks 393ms ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 98%
            default 5ms ▇▇ 1%
            Total 400ms


            Create Theme Files and use them in Magento 2



            In Magento 2, themes are stored in the file system in the following pattern:



            app/design/frontend///



            For a minimal setup, we create a theme which inherits everything from Luma. So we create the following files:




            /',
            DIR );



            //theme.xml -->
            Vendor: Theme Name
            Magento/luma




            Two trivia we want to change right now, so that we can see right away that we no longer use the original Luma theme:




            // app/design/frontend///web/css/source/_theme.less
            @navigation__background: @color-blue1;
            @navigation-desktop-level0-item__color: @color-white;




            Then we select the theme in Magento 2’s backend:



            Stores > Configuration > Design > Design Theme



            Start the Frontend Workflow with Grunt



            Before we can really get to work, we need to tell Grunt that we have just created a new theme. And here is the file entry that does the trick:




            // dev/tools/grunt/configs/themes.js // Add following to config array:
            : {
            area: 'frontend',
            name: 'Vendor/Theme',
            locale: 'de_DE',
            files: [
            'css/styles-m',
            'css/styles-l'
            ],
            dsl: 'less'
            }




            Afterward, the following steps should be executed exactly once before starting to work:



            Clean static files and caches:




            grunt clean




            Collect resources and generate static files for our theme:




            grunt exec:




            Initialize the preprocessing:




            grunt less:




            Afterward, reload the frontend page!
            The first-page view might lead to excessively long load times since Magento 2 starts the preprocessing in the background which means that a great number of files need to be processed.



            Voilà! We have successfully changed Magento’s background color and font color in the menu using our own workflow.
            From now on, we can start the watch task:




            grunt watch




            If we change a LESS file, Grunt will automatically update all necessary files so we only have to reload the frontend (with the LiveReload browser plugin installed, you won’t even need to do that manually).



            Trouble Shooting



            Changing Files



            In some cases (e.g. adding new files) it might be necessary to initialize everything again:




            grunt clean



            grunt exec:



            grunt less:




            General “unidentified” problems



            The following checklist should reset the system and make changes visible:



            Delete the static files relevant for the theme in:
            pub/static/frontend/
            var/view_preprocessed/less/
            var/view_preprocessed/source/
            Delete the Magento caches (Backend, bin/magento CLI or n98-magerun2)
            bin/magento setup:static-content:deploy <lang_LANG>
            Start Grunt workflow





            share|improve this answer























            • I had specified that I don't want to change the core file dev/tools/grunt/configs/themes.js
              – Rafael Corrêa Gomes
              Aug 2 '17 at 1:56
















            6














            Set up Grunt Environment



            When the installation is finished, the next step is to setup the Grunt environment. All described steps are covered in the official Magento 2 documentation, although there it’s not as compactly summarised as it is here.



            First of all, we need node.js for our stack.



            Then we can install the Grunt CLI




            npm install -g grunt-cli




            followed by the initialization of the project specific dependencies




            cd && npm install




            To test if everything is correctly installed, use the following call:



            $ grunt
            Running "default" task

            I'm the default task and at the moment I'm empty, sorry :/

            Done, without errors.


            Execution Time (2016-02-01 08:54:44 UTC)
            loading tasks 393ms ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 98%
            default 5ms ▇▇ 1%
            Total 400ms


            Create Theme Files and use them in Magento 2



            In Magento 2, themes are stored in the file system in the following pattern:



            app/design/frontend///



            For a minimal setup, we create a theme which inherits everything from Luma. So we create the following files:




            /',
            DIR );



            //theme.xml -->
            Vendor: Theme Name
            Magento/luma




            Two trivia we want to change right now, so that we can see right away that we no longer use the original Luma theme:




            // app/design/frontend///web/css/source/_theme.less
            @navigation__background: @color-blue1;
            @navigation-desktop-level0-item__color: @color-white;




            Then we select the theme in Magento 2’s backend:



            Stores > Configuration > Design > Design Theme



            Start the Frontend Workflow with Grunt



            Before we can really get to work, we need to tell Grunt that we have just created a new theme. And here is the file entry that does the trick:




            // dev/tools/grunt/configs/themes.js // Add following to config array:
            : {
            area: 'frontend',
            name: 'Vendor/Theme',
            locale: 'de_DE',
            files: [
            'css/styles-m',
            'css/styles-l'
            ],
            dsl: 'less'
            }




            Afterward, the following steps should be executed exactly once before starting to work:



            Clean static files and caches:




            grunt clean




            Collect resources and generate static files for our theme:




            grunt exec:




            Initialize the preprocessing:




            grunt less:




            Afterward, reload the frontend page!
            The first-page view might lead to excessively long load times since Magento 2 starts the preprocessing in the background which means that a great number of files need to be processed.



            Voilà! We have successfully changed Magento’s background color and font color in the menu using our own workflow.
            From now on, we can start the watch task:




            grunt watch




            If we change a LESS file, Grunt will automatically update all necessary files so we only have to reload the frontend (with the LiveReload browser plugin installed, you won’t even need to do that manually).



            Trouble Shooting



            Changing Files



            In some cases (e.g. adding new files) it might be necessary to initialize everything again:




            grunt clean



            grunt exec:



            grunt less:




            General “unidentified” problems



            The following checklist should reset the system and make changes visible:



            Delete the static files relevant for the theme in:
            pub/static/frontend/
            var/view_preprocessed/less/
            var/view_preprocessed/source/
            Delete the Magento caches (Backend, bin/magento CLI or n98-magerun2)
            bin/magento setup:static-content:deploy <lang_LANG>
            Start Grunt workflow





            share|improve this answer























            • I had specified that I don't want to change the core file dev/tools/grunt/configs/themes.js
              – Rafael Corrêa Gomes
              Aug 2 '17 at 1:56














            6












            6








            6






            Set up Grunt Environment



            When the installation is finished, the next step is to setup the Grunt environment. All described steps are covered in the official Magento 2 documentation, although there it’s not as compactly summarised as it is here.



            First of all, we need node.js for our stack.



            Then we can install the Grunt CLI




            npm install -g grunt-cli




            followed by the initialization of the project specific dependencies




            cd && npm install




            To test if everything is correctly installed, use the following call:



            $ grunt
            Running "default" task

            I'm the default task and at the moment I'm empty, sorry :/

            Done, without errors.


            Execution Time (2016-02-01 08:54:44 UTC)
            loading tasks 393ms ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 98%
            default 5ms ▇▇ 1%
            Total 400ms


            Create Theme Files and use them in Magento 2



            In Magento 2, themes are stored in the file system in the following pattern:



            app/design/frontend///



            For a minimal setup, we create a theme which inherits everything from Luma. So we create the following files:




            /',
            DIR );



            //theme.xml -->
            Vendor: Theme Name
            Magento/luma




            Two trivia we want to change right now, so that we can see right away that we no longer use the original Luma theme:




            // app/design/frontend///web/css/source/_theme.less
            @navigation__background: @color-blue1;
            @navigation-desktop-level0-item__color: @color-white;




            Then we select the theme in Magento 2’s backend:



            Stores > Configuration > Design > Design Theme



            Start the Frontend Workflow with Grunt



            Before we can really get to work, we need to tell Grunt that we have just created a new theme. And here is the file entry that does the trick:




            // dev/tools/grunt/configs/themes.js // Add following to config array:
            : {
            area: 'frontend',
            name: 'Vendor/Theme',
            locale: 'de_DE',
            files: [
            'css/styles-m',
            'css/styles-l'
            ],
            dsl: 'less'
            }




            Afterward, the following steps should be executed exactly once before starting to work:



            Clean static files and caches:




            grunt clean




            Collect resources and generate static files for our theme:




            grunt exec:




            Initialize the preprocessing:




            grunt less:




            Afterward, reload the frontend page!
            The first-page view might lead to excessively long load times since Magento 2 starts the preprocessing in the background which means that a great number of files need to be processed.



            Voilà! We have successfully changed Magento’s background color and font color in the menu using our own workflow.
            From now on, we can start the watch task:




            grunt watch




            If we change a LESS file, Grunt will automatically update all necessary files so we only have to reload the frontend (with the LiveReload browser plugin installed, you won’t even need to do that manually).



            Trouble Shooting



            Changing Files



            In some cases (e.g. adding new files) it might be necessary to initialize everything again:




            grunt clean



            grunt exec:



            grunt less:




            General “unidentified” problems



            The following checklist should reset the system and make changes visible:



            Delete the static files relevant for the theme in:
            pub/static/frontend/
            var/view_preprocessed/less/
            var/view_preprocessed/source/
            Delete the Magento caches (Backend, bin/magento CLI or n98-magerun2)
            bin/magento setup:static-content:deploy <lang_LANG>
            Start Grunt workflow





            share|improve this answer














            Set up Grunt Environment



            When the installation is finished, the next step is to setup the Grunt environment. All described steps are covered in the official Magento 2 documentation, although there it’s not as compactly summarised as it is here.



            First of all, we need node.js for our stack.



            Then we can install the Grunt CLI




            npm install -g grunt-cli




            followed by the initialization of the project specific dependencies




            cd && npm install




            To test if everything is correctly installed, use the following call:



            $ grunt
            Running "default" task

            I'm the default task and at the moment I'm empty, sorry :/

            Done, without errors.


            Execution Time (2016-02-01 08:54:44 UTC)
            loading tasks 393ms ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 98%
            default 5ms ▇▇ 1%
            Total 400ms


            Create Theme Files and use them in Magento 2



            In Magento 2, themes are stored in the file system in the following pattern:



            app/design/frontend///



            For a minimal setup, we create a theme which inherits everything from Luma. So we create the following files:




            /',
            DIR );



            //theme.xml -->
            Vendor: Theme Name
            Magento/luma




            Two trivia we want to change right now, so that we can see right away that we no longer use the original Luma theme:




            // app/design/frontend///web/css/source/_theme.less
            @navigation__background: @color-blue1;
            @navigation-desktop-level0-item__color: @color-white;




            Then we select the theme in Magento 2’s backend:



            Stores > Configuration > Design > Design Theme



            Start the Frontend Workflow with Grunt



            Before we can really get to work, we need to tell Grunt that we have just created a new theme. And here is the file entry that does the trick:




            // dev/tools/grunt/configs/themes.js // Add following to config array:
            : {
            area: 'frontend',
            name: 'Vendor/Theme',
            locale: 'de_DE',
            files: [
            'css/styles-m',
            'css/styles-l'
            ],
            dsl: 'less'
            }




            Afterward, the following steps should be executed exactly once before starting to work:



            Clean static files and caches:




            grunt clean




            Collect resources and generate static files for our theme:




            grunt exec:




            Initialize the preprocessing:




            grunt less:




            Afterward, reload the frontend page!
            The first-page view might lead to excessively long load times since Magento 2 starts the preprocessing in the background which means that a great number of files need to be processed.



            Voilà! We have successfully changed Magento’s background color and font color in the menu using our own workflow.
            From now on, we can start the watch task:




            grunt watch




            If we change a LESS file, Grunt will automatically update all necessary files so we only have to reload the frontend (with the LiveReload browser plugin installed, you won’t even need to do that manually).



            Trouble Shooting



            Changing Files



            In some cases (e.g. adding new files) it might be necessary to initialize everything again:




            grunt clean



            grunt exec:



            grunt less:




            General “unidentified” problems



            The following checklist should reset the system and make changes visible:



            Delete the static files relevant for the theme in:
            pub/static/frontend/
            var/view_preprocessed/less/
            var/view_preprocessed/source/
            Delete the Magento caches (Backend, bin/magento CLI or n98-magerun2)
            bin/magento setup:static-content:deploy <lang_LANG>
            Start Grunt workflow






            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited yesterday









            Rafael Corrêa Gomes

            4,24722962




            4,24722962










            answered Aug 1 '17 at 6:58









            Prakash PatelPrakash Patel

            1,066615




            1,066615












            • I had specified that I don't want to change the core file dev/tools/grunt/configs/themes.js
              – Rafael Corrêa Gomes
              Aug 2 '17 at 1:56


















            • I had specified that I don't want to change the core file dev/tools/grunt/configs/themes.js
              – Rafael Corrêa Gomes
              Aug 2 '17 at 1:56
















            I had specified that I don't want to change the core file dev/tools/grunt/configs/themes.js
            – Rafael Corrêa Gomes
            Aug 2 '17 at 1:56




            I had specified that I don't want to change the core file dev/tools/grunt/configs/themes.js
            – Rafael Corrêa Gomes
            Aug 2 '17 at 1:56













            1














            You can use below code to configure you custom theme for grunt in theme.js file:



            blue: {
            area: 'frontend',
            name: 'Colors/blue',
            locale: 'en_US',
            files: [
            'css/styles-m',
            'css/styles-l',
            'css/my'
            ],
            dsl: 'less'
            },


            Above cofiguration as per my theme path : appdesignfrontendColorsblue, You have to change as per your vendor(Colors) and theme name(blue),



            And run command:



            grunt exec:blue  
            grunt less:blue
            grunt watch





            share|improve this answer





















            • Where do I need to create the theme.js?
              – Rafael Corrêa Gomes
              Aug 2 '17 at 1:54










            • You do not have to create theme.js file, you can find this file at <root>devtoolsgruntconfigs.
              – Dipesh Rangani
              Aug 2 '17 at 5:01










            • So, I described that I don't want to change a core file.
              – Rafael Corrêa Gomes
              Aug 2 '17 at 19:19
















            1














            You can use below code to configure you custom theme for grunt in theme.js file:



            blue: {
            area: 'frontend',
            name: 'Colors/blue',
            locale: 'en_US',
            files: [
            'css/styles-m',
            'css/styles-l',
            'css/my'
            ],
            dsl: 'less'
            },


            Above cofiguration as per my theme path : appdesignfrontendColorsblue, You have to change as per your vendor(Colors) and theme name(blue),



            And run command:



            grunt exec:blue  
            grunt less:blue
            grunt watch





            share|improve this answer





















            • Where do I need to create the theme.js?
              – Rafael Corrêa Gomes
              Aug 2 '17 at 1:54










            • You do not have to create theme.js file, you can find this file at <root>devtoolsgruntconfigs.
              – Dipesh Rangani
              Aug 2 '17 at 5:01










            • So, I described that I don't want to change a core file.
              – Rafael Corrêa Gomes
              Aug 2 '17 at 19:19














            1












            1








            1






            You can use below code to configure you custom theme for grunt in theme.js file:



            blue: {
            area: 'frontend',
            name: 'Colors/blue',
            locale: 'en_US',
            files: [
            'css/styles-m',
            'css/styles-l',
            'css/my'
            ],
            dsl: 'less'
            },


            Above cofiguration as per my theme path : appdesignfrontendColorsblue, You have to change as per your vendor(Colors) and theme name(blue),



            And run command:



            grunt exec:blue  
            grunt less:blue
            grunt watch





            share|improve this answer












            You can use below code to configure you custom theme for grunt in theme.js file:



            blue: {
            area: 'frontend',
            name: 'Colors/blue',
            locale: 'en_US',
            files: [
            'css/styles-m',
            'css/styles-l',
            'css/my'
            ],
            dsl: 'less'
            },


            Above cofiguration as per my theme path : appdesignfrontendColorsblue, You have to change as per your vendor(Colors) and theme name(blue),



            And run command:



            grunt exec:blue  
            grunt less:blue
            grunt watch






            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Aug 1 '17 at 6:47









            Dipesh RanganiDipesh Rangani

            1,7612931




            1,7612931












            • Where do I need to create the theme.js?
              – Rafael Corrêa Gomes
              Aug 2 '17 at 1:54










            • You do not have to create theme.js file, you can find this file at <root>devtoolsgruntconfigs.
              – Dipesh Rangani
              Aug 2 '17 at 5:01










            • So, I described that I don't want to change a core file.
              – Rafael Corrêa Gomes
              Aug 2 '17 at 19:19


















            • Where do I need to create the theme.js?
              – Rafael Corrêa Gomes
              Aug 2 '17 at 1:54










            • You do not have to create theme.js file, you can find this file at <root>devtoolsgruntconfigs.
              – Dipesh Rangani
              Aug 2 '17 at 5:01










            • So, I described that I don't want to change a core file.
              – Rafael Corrêa Gomes
              Aug 2 '17 at 19:19
















            Where do I need to create the theme.js?
            – Rafael Corrêa Gomes
            Aug 2 '17 at 1:54




            Where do I need to create the theme.js?
            – Rafael Corrêa Gomes
            Aug 2 '17 at 1:54












            You do not have to create theme.js file, you can find this file at <root>devtoolsgruntconfigs.
            – Dipesh Rangani
            Aug 2 '17 at 5:01




            You do not have to create theme.js file, you can find this file at <root>devtoolsgruntconfigs.
            – Dipesh Rangani
            Aug 2 '17 at 5:01












            So, I described that I don't want to change a core file.
            – Rafael Corrêa Gomes
            Aug 2 '17 at 19:19




            So, I described that I don't want to change a core file.
            – Rafael Corrêa Gomes
            Aug 2 '17 at 19:19











            1














            You can copy file /dev/tools/grunt/configs/themes.js to /dev/tools/grunt/configs/local-themes.js



            Then edit Gruntfile.js file in your magento root folder :



            At line 19, change dev/tools/grunt/configs/themes to dev/tools/grunt/configs/local-themes



            Hope that helps.






            share|improve this answer


























              1














              You can copy file /dev/tools/grunt/configs/themes.js to /dev/tools/grunt/configs/local-themes.js



              Then edit Gruntfile.js file in your magento root folder :



              At line 19, change dev/tools/grunt/configs/themes to dev/tools/grunt/configs/local-themes



              Hope that helps.






              share|improve this answer
























                1












                1








                1






                You can copy file /dev/tools/grunt/configs/themes.js to /dev/tools/grunt/configs/local-themes.js



                Then edit Gruntfile.js file in your magento root folder :



                At line 19, change dev/tools/grunt/configs/themes to dev/tools/grunt/configs/local-themes



                Hope that helps.






                share|improve this answer












                You can copy file /dev/tools/grunt/configs/themes.js to /dev/tools/grunt/configs/local-themes.js



                Then edit Gruntfile.js file in your magento root folder :



                At line 19, change dev/tools/grunt/configs/themes to dev/tools/grunt/configs/local-themes



                Hope that helps.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered May 3 '18 at 15:54









                Céline GarelCéline Garel

                348




                348






























                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Magento Stack Exchange!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.





                    Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                    Please pay close attention to the following guidance:


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f176892%2fhow-to-configure-the-theme-to-use-grunt%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    1300-talet

                    1300-talet

                    Has there ever been an instance of an active nuclear power plant within or near a war zone?