@trigen/scripts-preset-react-app

React app scripts preset.

Usage no npm install needed!

<script type="module">
  import trigenScriptsPresetReactApp from 'https://cdn.skypack.dev/@trigen/scripts-preset-react-app';
</script>

README

@trigen/scripts-preset-react-app

NPM version Node version Dependencies status Build status Dependabot badge

React app scripts preset.

Usage

  1. Install scripts package
yarn add -D @trigen/scripts-preset-react-app
  1. Add installed scripts to .trigenscriptsrc
[
    "preset-react-app",
    "./some/other"
]
  1. Now you can run some script
yarn exec -- trigen-scripts start

Options

Option Type Default Description
testSkipBuild boolean false Skip build step while testing.
transpile object - Dependencies transpilation config.
transpile.dependencies string[] - Package names to force enable Babel.
transpile.extensions string[] - Files extensions to force enable Babel.
bdsl object - bdsl-webpack-plugin config.
preact boolean false Use Preact instead of React.

Available scripts

# Lint only styles
yarn lint:styles
# Lint only scripts
yarn lint:scripts
# Lint all sources
yarn lint
# Run tests with Jest
yarn jest
# Run type checking
yarn typecheck
# Run lint, tests and build
yarn test
# Generate docs for typescript sources
yarn build:docs
# Start Storybook
yarn start:storybook
# Build standalone Storybook bundle
yarn build:storybook
# Start development server
yarn start
# Build app
yarn build
# Build app renderer
yarn build:render
# Build and run renderer
yarn render
# Serve files from `build` directory
yarn serve

Environment variables

Optional variables:

PROXY_API_URI='' # valid URI; not set by default
DISABLE_BROWSER_SYNC=false # boolean; `false` by default
DISABLE_HISTORY_FALLBACK=false # boolean; `false` by default

You can create .env in project root with this variables.