Modular Grommet

This page will provide you with recommendations for creating a modular application using Grommet.

In this exercise you will use the NPM version of Grommet. The Get Started page provides instructions on installing Grommet with NPM.

Application Structure

As your application grows, you will likely feel the need to divide your code into smaller modules. Diving your code into modules is a common strategy for large-scale projects as it helps with parallel development and debugging. As a result, we recommend you structure your Grommet application as follows:


        {"/sample-app\n  /src\n    /js\n      /actions\n      /constants\n      /components\n      /stores\n      index.js\n    /scss\n    index.html\n  gulpfile.js\n  package.json\n"}
      

If you use the grommet command, it will generate your project following the recommended structure. Grommet also includes a set of Gulp tasks that are intended to enable a highly productive developer experience and creation of production-ready apps.

Predefined Gulp Tasks

These Gulp tasks are available for you to run in the root folder of your application.