3.4.4 • Published 4 years ago

starter-scripts v3.4.4

Weekly downloads
1
License
MIT
Repository
github
Last release
4 years ago

starter-scripts

A custom fork of react-scripts. This package includes scripts and configuration used by Create React App. Please refer to its documentation:

  • User Guide – How to develop apps bootstrapped with Create React App.

Getting Started

Create an App

$ yarn create react-app --scripts-version starter-scripts my-app

or update an existing project, install starter-scripts.

$ yarn add starter-scripts

Next, replace react-scripts with starter-scripts in package.json.

{
  "scripts": {
    "start": "starter-scripts start",
    "build": "starter-scripts build",
    "test": "starter-scripts test",
    "eject": "starter-scripts eject"
  }
}

If you created project with typescript template, replace types="react-scripts" /> with types="starter-scripts" in react-app-env.d.ts.

/// <reference types="starter-scripts" />

Why use starter-scripts instead of react-scripts ?

  1. Enjoy a custom attribute styleName make you combine react and css-module in a concise way. (see more on react-css-modules)

    // component.jsx
    import './hello.module.css'
    
    <span styleName='bar'>World</span>
    // "bar" is a class name defined in `hello.module.css` and do not pollute any other class.
  2. Enjoy your custom css plugins. Install all required postcss plugins and add postcss.config.js in the project root.

    // postcss.config.js
    module.exports = {
      plugins: {
        'postcss-plugin': {},
      },
    };