mosaic
  • Overview
  • Integration
    • Next.js
    • Create React App
    • Webpack
  • Getting started
    • Extensions
    • Themes
  • Tutorials
    • Mosaic + React
    • Mosaic + Webpack
  • Install an extension
    • Install a local extension
    • Install with a package manager
    • Enable or disable an extension
  • Develop an extension
    • Anatomy of an extension
    • Namespaces
    • Runtime plugins
    • Build configuration plugins
  • CRA features
    • CRACO plugins
  • Next.js features
    • Styles
    • Pages
    • Common props
  • Architecture examples
    • Router
  • Themes
    • Parent theme system
    • File shadowing
  • Experimental
    • Module preferences
    • File provisioning
  • in-depth
    • How does it work?
Powered by GitBook
On this page

Was this helpful?

  1. Integration

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
npm install @tilework/mosaic-nextjs-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"
    }
}
PreviousNext.jsNextWebpack

Last updated 4 years ago

Was this helpful?