Wordle Picker
Picker for Wordle game built with React 18. Based on Cacher-Frontend-React.
Configuration, building and launching
All configuration, npm and webpack scripts are modified ones from react-scripts eject
with specific purposes of this project.
Commands
npm i --production
– Install only necessary npm dependencies. Or install everything withnpm i
for development.npm run start
– Start dev server. File.env.production
will not be used so consider creating local environment filenpm run build
– More about environment and buildsnpm run lint
– Check project witheslint
Sites build environment
npm run build
– Generate production version of frontend using environment file.env.production
File .env.production
contain environment variables for building scripts and for client usage. Some of those env variables:
name | description/type |
---|---|
REACT_APP_VERSION |
Same as in package.json . Used for client cache control |
REACT_APP_CACHE_STORAGE_NAME |
Name of cache storage for browsers |
BUILD_PATH |
Build directory for webpack output |
GENERATE_SOURCEMAP |
Explicitly set to false (but modification in webpack.config.js allows to skip it) |
PUBLIC_URL |
Root of project |
REACT_APP_PRIMARY_COLOR |
Hex color, used in manifest and index.html templates |
You may pass more variables, see standard react-scripts
and webpack
docs.
Local environment
You may create own local env (e.g. .env.development.local). It needs everything from build env and contains optional values:
- set
HTTPS=true
to use https on local development server. If applied, setSSL_CRT_FILE
andSSL_KEY_FILE
as paths to certificate and key files. PORT
– port of dev server.DISABLE_ESLINT_PLUGIN=true
– disables esling plugin for webpack (warning overlay).
Manifest and PWA
Manifest is built with npm run build
from template in scripts/build
. PWA is controlled by cache.js
and Service Worker (Cache first for static, network first for API), which is built with Webpack Service Worker Plugin.