Create React App

In order to integrate Mosaic into a create-react-app project, the following steps should be performed

Install the dependencies

Using mosaic requires two packages in your create-react-app project - the start script package and the runtime package.

yarn add @tilework/mosaic-cra-scripts @tilework/mosaic

Use the new scripts

Replace react-scripts invocations in the scripts block of your package.json. Such way, the build process will be launched with additional configurations (Webpack and Babel) required for Mosaic.

package.json
{
    "scripts": {
        "start": "cra-scripts start",
        "build": "cra-scripts build",    
        "test": "cra-scripts test",      
        "link": "cra-scripts link"
    }
}

Last updated