FrontEnd Scripts
$ create-react-app my-app --scripts-version frontend-scripts
FrontEnd Scripts makes it easy to spin up a react app with all of the functionality to be desired from the OG Create React App.
Quick Overview
create-react-app my-app --scripts-version frontend-scripts
cd my-app
npm start
Then open http://localhost:3000/ to see your app.
When you’re ready to deploy to production, create a minified bundle with npm run build
, just like usual.
What's new
Bundled packages:
Bundled configs:
- Hot Module Replacement for JS (CRA only supports hot reloading for CSS)
- Absolute path for everything under the
src
folder- Reduces the extra
../../
for imports - eg:
import SomeComponent from 'components/SomeComponent'
- Reduces the extra
- Babel Transform Decorators
- Babel React CSS Modules (configured for scss)
Bundled eye-candy:
Breaking differences:
babel-plugin-react-css-modules
This boilerplate adds support for CSS-Modules with an scss
flavor.
What this means:
- All imported
.scss
files are by default treated as local modules. - Styles are applied slightly differently:
- Use the
styleName
prop for a local style - Use the
className
prop for a global style (src/styles/global.scss
)
Note: all .css files are treated as they normally would be.
Please refer to the original documentation for everything else:
- Getting Started – How to create a new app.
- User Guide – How to develop apps bootstrapped with Create React App.