Commit 567921d9 authored by Dan Abramov's avatar Dan Abramov
Browse files

Merge branch 'docusaurus'

parents 67fb2654 b652a98e
main 3.x add-babel-plugin-optimize-react amyrlam-patch-1 dependabot/npm_and_yarn/follow-redirects-1.14.8 dependabot/npm_and_yarn/nanoid-3.3.1 dependabot/npm_and_yarn/prismjs-1.27.0 feat/audits github-actions-ci github/fork/AMS777/patch-3 github/fork/Aghassi/patch-1 github/fork/AkiJoey/master github/fork/AlexWebLab/patch-1 github/fork/Amila-Rukshan/patch-1 github/fork/AmyShackles/patch-1 github/fork/Andarist/fix/manifest-handle-all-entrypoints github/fork/Andarist/improve-code-comments github/fork/Andarist/patch-2 github/fork/Andarist/remove-babel-core-from-preset-deps github/fork/AriPerkkio/pr/fix-slow-app-creation github/fork/AryaAnish121/patch-1 github/fork/AshmeetSingh987/master github/fork/Ayushparikh-code/patch-1 github/fork/BenBonno/main github/fork/Bluefitdev/master github/fork/Bnaya/webpack-ignore-irrelevant-warnings github/fork/BogdanDor/remove-webpackHotDevClient github/fork/BrainEno/yakai911 github/fork/CarlRibbegaardh/feature/filename github/fork/CarlRibbegaardh/feature/tsconfig-config github/fork/CharlesStover/001 github/fork/ChithurajMsys/patch-1 github/fork/CommanderRoot/refactor/rm-deprecated-substr github/fork/DanielBailey-web/patch-1 github/fork/DavidKessel/website-update github/fork/DemonHa/add-fullySpecified-cofiguration github/fork/Ekwuno/add-cloudflare-pages-to-deploy github/fork/Emanisay/emanisay27-patch-2 github/fork/ErfanMirzapour/master github/fork/FeatherBlack/master github/fork/Ferri0/patch-1 github/fork/FezVrasta/feat/profile-env-variable github/fork/FezVrasta/patch-5 github/fork/FezVrasta/patch-6 github/fork/FezVrasta/wp5-worker-url-plugin github/fork/FloydJohn/fix-browser-env github/fork/FontEndArt/main github/fork/Garciaa94/patch-1 github/fork/GiaKhai/patch-1 github/fork/HAMED-NIYAZI/patch-1 github/fork/Haosik/patch-1 github/fork/HewlettPackard/main github/fork/HollyPony/main github/fork/HugoGEORGET/fix-proxy-middleware-documentation github/fork/HumbertoL/fix/remove-extra-period github/fork/JLHwung/fix-failing-master github/fork/Jarryxin/main github/fork/Jarryxin/wp5 github/fork/JensColman/patch-1 github/fork/Jhinpan/patch-1 github/fork/Jiacheng787/main github/fork/KennethSundqvist/mocking-node-modules github/fork/Kingwl/InlineChunkHtmlPlugin_defer github/fork/KurtGokhan/lint-command github/fork/Lesliemicheal111/patch-1 github/fork/LinusU/disable-tsc-plugin github/fork/M-Usman-Tahir/patch-1 github/fork/M779-star/patch-1 github/fork/Manc/patch github/fork/ManishINN/main github/fork/MarcusMorba/patch-3 github/fork/MartijnHols/fix/12044-dont-install-tailwindcss github/fork/Methuselah96/add-missing-peer-dependencies github/fork/MichaelDeBoey/patch-1 github/fork/MichaelDeBoey/patch-2 github/fork/Mk-Etlinger/patch-2 github/fork/MozhganShafiee/main github/fork/Mrman/core-js-config-change github/fork/Nareshdhori/circleci-project-setup github/fork/NeoLegends/fix/create-element github/fork/NightWalker9/patch-2 github/fork/NoamGaash/patch-1 github/fork/PeteSchuster/patch-1 github/fork/Ph0enixKM/patch-1 github/fork/PranavSenthilnathan/setupProxyTs github/fork/Rahim-Chan/fix/filename github/fork/RakeshPotnuru/patch-1 github/fork/RomainTHD/main github/fork/Seokkitdo/patch-1 github/fork/SiegfriedEhret/patch-1 github/fork/Skyscanner/leop-317-sassfunction github/fork/SyedMuhammedBilal/patch-2 github/fork/SyedMuhammedBilal/patch-4 github/fork/TheAli711/main github/fork/TheLarkInn/feature/organize-config github/fork/TitusEfferian/titusefferian/docs/pre-render github/fork/TrySound/upgrade-svgr-6 github/fork/VNDRMKT/main github/fork/VoloshchenkoAl/babel-plugin-formatjs github/fork/WesCossick/fix-missing-build-error-paths github/fork/YehudaKremer/patch-1 github/fork/YuanXingH/fix/webpack-tsc-compile-on-error github/fork/ace4port/patch-1 github/fork/acusti/template-comment-typo-fix github/fork/adebiyi-al/docs/deployment github/fork/admindivyansh/patch-2 github/fork/adrielcodeco/main github/fork/aixfox/master github/fork/ajbogh/main github/fork/akolade011/dev github/fork/akuji1993/master github/fork/alexandr-g/deps/husky-v5 github/fork/alexkev/running-tests-recommended-wording github/fork/alexxyzeng/main github/fork/allanzi/patch-1 github/fork/amatissart/fix-webpack-config-glob github/fork/amcgee/feat-auto-publicpath github/fork/amehdaly/master github/fork/andrearota/master github/fork/andrzej-erli/patch-1 github/fork/ankitmadhwani24/main github/fork/annie-kat/patch-1 github/fork/antzshrek/master github/fork/anuragarwalkar/patch-1 github/fork/atefBB/patch-1 github/fork/await-ovo/fix-docs-add-typescript github/fork/await-ovo/fix-missing-postcss-plugins github/fork/aymans/patch-1 github/fork/ayush987goyal/pr/chunk-minsize github/fork/barionleg/amyrlam-patch-1 github/fork/barionleg/unpin-babel-loader github/fork/bbrk24/main github/fork/bdenhollander/patch-1 github/fork/behnammodi/total-size github/fork/benjaminr-ps/add-wds-socket-protocol github/fork/benjaminr-ps/patch-1 github/fork/bhardwajhimanshu219/svgr-webpack-version-upgrade github/fork/binary-person/patch-1 github/fork/bkrausz/patch-1 github/fork/bluenote10/bugfix/attempt_to_fix_custom_loader_race_condition github/fork/bmuenzenmeyer/master github/fork/bradjones1/patch-1 github/fork/bradoyler/patch-1 github/fork/breyed/patch-1 github/fork/british-council/fix/yarn-link-lerna github/fork/buuug7/patch-1 github/fork/c-w/remove-style-loader github/fork/camjackson/master github/fork/candrews/dropconsole github/fork/carlosparreno/v5-fix-splitchunks-issue-prod-build github/fork/caub/patch-1 github/fork/ceithir/editorconfig github/fork/chadwithuhc/patch-1 github/fork/challet/patch-launchEditor github/fork/cheesestringer/fix-package-lock-json github/fork/cheesestringer/update-measuring-performance github/fork/christopher-francisco/dart-sass github/fork/chybisov/patch-1 github/fork/cindyledev/issue-7886 github/fork/codybentson2/patch-1 github/fork/cprecioso/no-svgr-url-import github/fork/cszo/homepage-fix github/fork/cybermerlin/hotfix/jest_upgrade github/fork/daceynolan/typescript-ambiet-modules-docs github/fork/dan-valentine/Allow-Proxy-to-be-set-by-environment-variables github/fork/danconnell/react-error-overlay-nonce github/fork/danielmahon/master github/fork/danvc/all_add_multiple_entry_points_1084 github/fork/darthmaim/patch-1 github/fork/daschaa/main github/fork/daylesalmon/patch-1 github/fork/dblazheski96/entry-path-variable github/fork/ddzz/gha-update github/fork/dedo1911/main github/fork/demurgos/fix/12625-ts-node16 github/fork/demurgos/fix/7147-ts-composite github/fork/derbyshire10/main github/fork/devinrhode2/patch-1 github/fork/dilanx/patch-1 github/fork/donnygitsome/main github/fork/draculapile/fix/babel-parser-error github/fork/dtran320/patch-1 github/fork/dylan8902/patch-1 github/fork/easyandme/patch-1 github/fork/eckdanny/docs/add-skip-preflight-check-docs github/fork/elrumordelaluz/patch-1 github/fork/elrumordelaluz/patch-2 github/fork/email2vimalraj/master github/fork/entropitor/fix-no-emit github/fork/etalab/cra-envs github/fork/eventualbuddha/add-@babel/plugin-proposal-private-property-in-object-dependency github/fork/fanny/master github/fork/fivecar/cache_clear_docs github/fork/fkirc/fix_slow_recompile_times github/fork/forana/clear-console github/fork/fupengl/master github/fork/gabrieldejesus/patch-1 github/fork/gaearon/hot-reload-again github/fork/gdethier/main github/fork/geewoo94/config/tailwind github/fork/gergelypap/fix/remove-noopener github/fork/getzelus/patch-1 github/fork/giovannibenussi/loading-indicator github/fork/giovannibenussi/master github/fork/gminova/fix/remove-redundant-imports github/fork/happymonday/master github/fork/hasanayan/module-federation github/fork/herbievine/patch-1 github/fork/hermansje/feat/jsxImportSource github/fork/heygrady/preset-env-modern github/fork/hoangle4/patch-1 github/fork/huyenltnguyen/patch-1 github/fork/iamayushdas/codeblocks github/fork/iamstarkov/patch-1 github/fork/iansu/drop-node-14 github/fork/iansu/node-17-ci github/fork/iansu/worker-loader github/fork/improper/bugfix/version-check-breaks-file-path-usage github/fork/ioloie/enable-write-to-disk github/fork/ivanmcgregor/patch-1 github/fork/izzygld/patch-1 github/fork/jaime-ez/patch-1 github/fork/jakejakeho/patch-1 github/fork/jamescostian/improve-setup-proxy-extension-support github/fork/jamescostian/improve_ts_extension_support github/fork/jameswithers89/patch-1 github/fork/jamidwyer/fix/error-overlay-iframe-axe github/fork/jamirvin/main github/fork/jayeshmann/patch-1 github/fork/jean-smaug/bump-jest-in-react-scripts github/fork/jmgregory/stable-env-var-order github/fork/joeldenning/cjs-support github/fork/joelparkerhenderson/main github/fork/joey-laminar/patch-1 github/fork/johnnyreilly/patch-1 github/fork/jomarquez21/avoid-casting-on-root-element github/fork/jonatanklosko/jk-stdin-close-exit github/fork/joostlubach/joostlubach-open-browser github/fork/judycodes/patch-1 github/fork/jwalton9/main github/fork/karlhorky/patch-1 github/fork/karlhorky/patch-2 github/fork/kavinkuma6/patch-1 github/fork/kaykayehnn/fix-react-error-overlay-ts-errors github/fork/kayuapi/patch-1 github/fork/khalidwaleed0/patch-1 github/fork/kiancross/sass-loader-peer-dep github/fork/kidroca/patch-1 github/fork/kingsmendv/patch-for-pnp github/fork/kitsunekyo/feat/allow-postcss-config-override github/fork/kixxer01/patch-1 github/fork/knopp10000/patch-1 github/fork/kopyl/patch-1 github/fork/krotovic/master github/fork/krreet/swap-babel-out-with-swc-in-start-build-and-test-2 github/fork/larixer/main github/fork/laxsuryavanshi/main github/fork/ldeninski/bugfix/add-missing-cjs-extension-to-webpack-config github/fork/levrik/editor-detection-wsl github/fork/lfshr/issue-8596/fix-win32-resolve-url-loader github/fork/limal/patch-1 github/fork/llshicc/master github/fork/louy2/patch-1 github/fork/luanorlandi/docs/react-scripts-dependency github/fork/lucabattistini/feat/webpack-svgr-loader github/fork/lucasff/patch-1 github/fork/ludofischer/reduce-noise github/fork/luffy84217/fix-webpack-dev-server-deprecated-option github/fork/luwuer/logo-cannot-be-selected github/fork/luxp/master github/fork/macjabeth/jonathan-picazo github/fork/maksimdegtyarev/remove-react-import github/fork/manavm1990/main github/fork/maoqxxmm/fix/typo github/fork/marcofugaro/cache-directory-jest github/fork/marvelsrp/hotfix-lint-treads github/fork/mcfedr/cjs-support github/fork/mdevils/update-html-entities-with-flow-types github/fork/merceyz/merceyz/fix/missing-dependencies github/fork/milesibastos/patch-1 github/fork/mkarajohn/fix-absolute-paths-in-jest-config-modulePaths github/fork/mmazzarolo/patch-1 github/fork/modernizer-bot/explicit-path-5 github/fork/mohd-akram/add-eslint-context-rule github/fork/morellodev/patch-1 github/fork/mrduguo/main github/fork/mrmckeb/feature/verify-git-package-names github/fork/msaaddev/primary-branch-main github/fork/mwangel/master github/fork/n6g7/custom-host-port github/fork/nategiraudeau/patch-1 github/fork/nattwasm/main github/fork/nfriend/nfriend-add-_redirects-file github/fork/nicgirault/patch-1 github/fork/nickmccurdy/add-prettier-config-to-app github/fork/nickmccurdy/feature/remove-remaining-react-imports github/fork/nickmccurdy/move-e2e-tests-to-github-actions github/fork/nickmccurdy/patch-1 github/fork/nickmccurdy/patch-2 github/fork/nickmccurdy/replace-npx github/fork/nickmccurdy/revert-web-vitals github/fork/nico-martin/manifets-json-to-serviceworker github/fork/nnmax/fix/throwAnUnknowError github/fork/nvh95/file-transform github/fork/omar-bakhsh/patch-1 github/fork/oparaskos/patch-1 github/fork/opencollective/opencollective github/fork/p-avital/patch-2 github/fork/p12tic/fix-dev-server-proxy-broken-origin-header github/fork/pan-alexey/main github/fork/paramt/patch-2 github/fork/pdsouza/patch-1 github/fork/pedr0ni/main github/fork/pedro-demeu/patch-1 github/fork/pedromello/patch-1 github/fork/penx/patch-3 github/fork/ph-fritsche/update-template github/fork/phated/phated/postcss-loader-upgrade github/fork/philn5d-ar/patch-1 github/fork/pnarielwala/patch-1 github/fork/pradhul-dev/patch-1 github/fork/priyankgandhi/patch-1 github/fork/proflayton/brandon/add-no-bin-link-option github/fork/pstrh/pr/increase-css-module-hash-uniqueness github/fork/purelledhand/feat/support-disable-incremental-build github/fork/pushred/resolve-url-loader-v5 github/fork/puxiao/main github/fork/qubbit/patch-1 github/fork/raix/swap-babel-out-with-swc-in-start-build-and-test github/fork/raix/v5-add-back-support-for-node-builtins github/fork/raix/v5-add-react-runtime-aliases github/fork/raix/v5-fix-react-error-overlay-build github/fork/raix/v5-fix-split-chunks-issue-prod-build github/fork/rannn505/patch-1 github/fork/redbmk/full-homepage-url github/fork/revolunet/patch-1 github/fork/rgbutov/patch-2 github/fork/rheh/main github/fork/rluvaton/use-module-ids github/fork/rojo20/react-testing-library-docs github/fork/rpivo/master github/fork/rreckonerr/patch-1 github/fork/rsylvian/patch-1 github/fork/ruckc/websocketurl github/fork/ryo-kagawa/doc-troubleshooting github/fork/ryota-murakami/feat/disableModuleScopePlugin github/fork/ryota-murakami/fix/format github/fork/sashashura/patch-1 github/fork/saurabhjdas786/patch-1 github/fork/saurabhjdas786/patch-2 github/fork/sbindass-deal/patch-1 github/fork/schalkventer/patch-1 github/fork/scottlamb/pr-print-stack github/fork/segheysens/main github/fork/serghei77/patch-1 github/fork/serranom/patch-1 github/fork/sheepsteak/paths github/fork/sheerun/wasm github/fork/shfshanyue/fix-inline-chunk github/fork/shhnjk/main github/fork/shian15810/no-const-enum github/fork/siddhantvirus/master github/fork/siddharthborderwala/patch-1 github/fork/siddtheone/patch-1 github/fork/silvareal/patch-1 github/fork/skoging/patch-2 github/fork/sumanthratna/image-optimization2 github/fork/sunil-sharma-999/main github/fork/svenliebig/master github/fork/swayamTA/test_branch github/fork/tanify/patch-1 github/fork/tanvirstreame/fix-project-directory github/fork/tanvirstreame/update-jest github/fork/tanvirstreame/update-type github/fork/tarikhamilton/patch-1 github/fork/tcope25/patch-1 github/fork/teemezzy/patch-2 github/fork/testower/patch-1 github/fork/tetedacier/patch-1 github/fork/textbook/dont-lint-deps github/fork/th13vn/main github/fork/thexpand/patch-1 github/fork/thisgeek/patch-1 github/fork/tmclo/main github/fork/tobiasbueschel/docs/docusaurus-readme github/fork/tobiasbueschel/master github/fork/tobiasbueschel/refactor/const github/fork/tomvalorsa/patch-1 github/fork/treuherz/main github/fork/trueadm/add-babel-plugin-optimize-react github/fork/unclechu/sandbox/wenzel/customizable-proxy-env-var github/fork/user7564/main github/fork/veltman/unambiguous-sourcetype github/fork/vikr01/fix/babel-env github/fork/viswa84/patch-1 github/fork/vlio20/patch-1 github/fork/webbertakken/patch-1 github/fork/wozzo/master github/fork/wsergent/patch-1 github/fork/xdiegors/patch-2 github/fork/xiaoxiangmoe/master github/fork/xtech-guru/add-less-support github/fork/yamankatby/patch-2 github/fork/yanneves/feature/no-restricted-globals github/fork/yicheny/fix_webpack5_cache_invalidation github/fork/ylemkimon/allowed-hosts github/fork/yvettep321/wp5 github/fork/zalox/master github/fork/zamarawka/feat/css-loacal-ident github/fork/zanemayo/patch-1 github/fork/zenotsai/mr/main/fix_build_cache github/fork/zhaomengfan/main github/fork/zhixiaoqiang/feature/react-dev-utils-export-guessEditor github/fork/zhoujingchao/main github/fork/zingbretsen/mdx-webpack-bugfix github/fork/zjffun/master lk/refactor-tests unpin-babel-loader wp5 v5.0.1 v5.0.0 v4.0.3 v4.0.2 v4.0.1 v4.0.0 v3.4.4 v3.4.3 v3.4.2 v3.4.1 v3.4.0 v3.3.1 v3.3.0 v3.2.0 v3.1.2 v3.1.1 v3.1.0 v3.0.1 v3.0.0 v2.1.8 v2.1.7 v2.1.6 v2.1.5 v2.1.4 v2.1.3 v2.1.2 v2.1.1 v2.1.0 react-scripts@5.0.1 react-scripts@5.0.0 react-scripts@4.0.3 react-scripts@4.0.2 react-scripts@4.0.1 react-scripts@4.0.0 react-scripts@3.4.1 react-scripts@3.4.0 react-scripts@3.3.1 react-scripts@3.3.0 react-scripts@3.2.0 react-scripts@3.1.2 react-scripts@3.1.1 react-scripts@3.1.0 react-scripts@3.0.1 react-scripts@3.0.0 react-scripts@2.1.8 react-scripts@2.1.7 react-scripts@2.1.6 react-scripts@2.1.5 react-scripts@2.1.4 react-scripts@2.1.3 react-scripts@2.1.2 react-scripts@2.1.1 react-scripts@2.1.0 react-error-overlay@6.0.11 react-error-overlay@6.0.10 react-error-overlay@6.0.9 react-error-overlay@6.0.8 react-error-overlay@6.0.7 react-error-overlay@6.0.6 react-error-overlay@6.0.5 react-error-overlay@6.0.4 react-error-overlay@6.0.3 react-error-overlay@6.0.2 react-error-overlay@6.0.1 react-error-overlay@6.0.0 react-error-overlay@5.1.6 react-error-overlay@5.1.5 react-error-overlay@5.1.4 react-error-overlay@5.1.3 react-error-overlay@5.1.2 react-error-overlay@5.1.1 react-error-overlay@5.1.0 react-error-overlay@5.0.6 react-dev-utils@12.0.1 react-dev-utils@12.0.0 react-dev-utils@11.0.3 react-dev-utils@11.0.2 react-dev-utils@11.0.1 react-dev-utils@11.0.0 react-dev-utils@10.2.1 react-dev-utils@10.2.0 react-dev-utils@10.1.0 react-dev-utils@10.0.0 react-dev-utils@9.1.0 react-dev-utils@9.0.4 react-dev-utils@9.0.3 react-dev-utils@9.0.2 react-dev-utils@9.0.1 react-dev-utils@9.0.0 react-dev-utils@8.0.0 react-dev-utils@7.0.5 react-dev-utils@7.0.4 react-dev-utils@7.0.3 react-dev-utils@7.0.2 react-dev-utils@7.0.1 react-dev-utils@7.0.0 react-dev-utils@6.1.1 react-dev-utils@6.1.0 react-app-polyfill@3.0.0 react-app-polyfill@2.0.0 react-app-polyfill@1.0.6 react-app-polyfill@1.0.5 react-app-polyfill@1.0.4 react-app-polyfill@1.0.3 react-app-polyfill@1.0.2 react-app-polyfill@1.0.1 react-app-polyfill@1.0.0 react-app-polyfill@0.2.2 react-app-polyfill@0.2.1 react-app-polyfill@0.2.0 eslint-config-react-app@7.0.1 eslint-config-react-app@7.0.0 eslint-config-react-app@6.0.0 eslint-config-react-app@5.2.1 eslint-config-react-app@5.2.0 eslint-config-react-app@5.1.0 eslint-config-react-app@5.0.2 eslint-config-react-app@5.0.1 eslint-config-react-app@5.0.0 eslint-config-react-app@4.0.1 eslint-config-react-app@4.0.0 eslint-config-react-app@3.0.8 eslint-config-react-app@3.0.7 eslint-config-react-app@3.0.6 eslint-config-react-app@3.0.5 create-react-app@5.0.1 create-react-app@5.0.0 create-react-app@4.0.3 create-react-app@4.0.2 create-react-app@4.0.1 create-react-app@4.0.0 create-react-app@3.4.1 create-react-app@3.4.0 create-react-app@3.3.1 create-react-app@3.3.0 create-react-app@3.2.0 create-react-app@3.1.2 create-react-app@3.1.1 create-react-app@3.1.0 create-react-app@3.0.1 create-react-app@3.0.0 create-react-app@2.1.8 create-react-app@2.1.7 create-react-app@2.1.6 create-react-app@2.1.5 create-react-app@2.1.4 create-react-app@2.1.3 create-react-app@2.1.2 create-react-app@2.1.1 create-react-app@2.1.0 cra-template-typescript@1.2.0 cra-template-typescript@1.1.3 cra-template-typescript@1.1.2 cra-template-typescript@1.1.1 cra-template-typescript@1.1.0 cra-template-typescript@1.0.3 cra-template-typescript@1.0.2 cra-template-typescript@1.0.1 cra-template-typescript@1.0.0 cra-template@1.2.0 cra-template@1.1.3 cra-template@1.1.2 cra-template@1.1.1 cra-template@1.1.0 cra-template@1.0.3 cra-template@1.0.2 cra-template@1.0.1 cra-template@1.0.0 confusing-browser-globals@1.0.11 confusing-browser-globals@1.0.10 confusing-browser-globals@1.0.9 confusing-browser-globals@1.0.8 confusing-browser-globals@1.0.7 confusing-browser-globals@1.0.6 confusing-browser-globals@1.0.5 babel-preset-react-app@10.0.1 babel-preset-react-app@10.0.0 babel-preset-react-app@9.1.2 babel-preset-react-app@9.1.1 babel-preset-react-app@9.1.0 babel-preset-react-app@9.0.2 babel-preset-react-app@9.0.1 babel-preset-react-app@9.0.0 babel-preset-react-app@8.0.0 babel-preset-react-app@7.0.2 babel-preset-react-app@7.0.1 babel-preset-react-app@7.0.0 babel-preset-react-app@6.1.0 babel-preset-react-app@6.0.0 babel-plugin-named-asset-import@0.3.8 babel-plugin-named-asset-import@0.3.7 babel-plugin-named-asset-import@0.3.6 babel-plugin-named-asset-import@0.3.5 babel-plugin-named-asset-import@0.3.4 babel-plugin-named-asset-import@0.3.3 babel-plugin-named-asset-import@0.3.2 babel-plugin-named-asset-import@0.3.1 babel-plugin-named-asset-import@0.3.0 babel-plugin-named-asset-import@0.2.3
3 merge requests!12191Lim.Pisey.168:/Identified - We are currently investigating reports of missing build logs. The issue has been identified and a resolution is in progress. We will provide a further update when available.Mar 21, 09:02 UTC,!12853brikk,!5717Automatically extract project file structure from build bundle file
Showing with 1283 additions and 3 deletions
+1283 -3
# Nothing to see here right now
Please refer to the [Readme](https://github.com/facebook/create-react-app/blob/master/README.md) or the [User Guide](https://github.com/facebook/create-react-app/blob/master/packages/react-scripts/template/README.md).
---
id: adding-a-css-modules-stylesheet
title: Adding A CSS Modules Stylesheet
sidebar_label: Adding CSS Modules
---
> Note: this feature is available with `react-scripts@2.0.0` and higher.
This project supports [CSS Modules](https://github.com/css-modules/css-modules) alongside regular stylesheets using the `[name].module.css` file naming convention. CSS Modules allows the scoping of CSS by automatically creating a unique classname of the format `[filename]\_[classname]\_\_[hash]`.
> **Tip:** Should you want to preprocess a stylesheet with Sass then make sure to [follow the installation instructions](/docs/adding-a-sass-stylesheet) and then change the stylesheet file extension as follows: `[name].module.scss` or `[name].module.sass`.
CSS Modules let you use the same CSS class name in different files without worrying about naming clashes. Learn more about CSS Modules [here](https://css-tricks.com/css-modules-part-1-need/).
## `Button.module.css`
```css
.error {
background-color: red;
}
```
## `another-stylesheet.css`
```css
.error {
color: red;
}
```
## `Button.js`
```js
import React, { Component } from 'react';
import styles from './Button.module.css'; // Import css modules stylesheet as styles
import './another-stylesheet.css'; // Import regular stylesheet
class Button extends Component {
render() {
// reference as a js object
return <button className={styles.error}>Error Button</button>;
}
}
```
## Result
No clashes from other `.error` class names
```html
<!-- This button has red background but not red text -->
<button class="Button_error_ax7yz"></div>
```
**This is an optional feature.** Regular `<link>` stylesheets and CSS files are fully supported. CSS Modules are turned on for files ending with the `.module.css` extension.
---
id: adding-a-router
title: Adding A Router
---
Create React App doesn't prescribe a specific routing solution, but [React Router](https://reacttraining.com/react-router/web/) is the most popular one.
To add it, run:
```sh
npm install --save react-router-dom
```
Alternatively you may use `yarn`:
```sh
yarn add react-router-dom
```
To try it, delete all the code in `src/App.js` and replace it with any of the examples on its website. The [Basic Example](https://reacttraining.com/react-router/web/example/basic) is a good place to get started.
Note that [you may need to configure your production server to support client-side routing](/docs/deployments#serving-apps-with-client-side-routing) before deploying your app.
---
id: adding-a-sass-stylesheet
title: Adding A Sass Stylesheet
sidebar_label: Adding Sass Stylesheets
---
> Note: this feature is available with `react-scripts@2.0.0` and higher.
Generally, we recommend that you don’t reuse the same CSS classes across different components. For example, instead of using a `.Button` CSS class in `<AcceptButton>` and `<RejectButton>` components, we recommend creating a `<Button>` component with its own `.Button` styles, that both `<AcceptButton>` and `<RejectButton>` can render (but [not inherit](https://facebook.github.io/react/docs/composition-vs-inheritance.html)).
Following this rule often makes CSS preprocessors less useful, as features like mixins and nesting are replaced by component composition. You can, however, integrate a CSS preprocessor if you find it valuable.
To use Sass, first install `node-sass`:
```bash
$ npm install node-sass --save
$ # or
$ yarn add node-sass
```
Now you can rename `src/App.css` to `src/App.scss` and update `src/App.js` to import `src/App.scss`.
This file and any other file will be automatically compiled if imported with the extension `.scss` or `.sass`.
To share variables between Sass files, you can use Sass imports. For example, `src/App.scss` and other component style files could include `@import "./shared.scss";` with variable definitions.
This will allow you to do imports like
```scss
@import 'styles/_colors.scss'; // assuming a styles directory under src/
@import '~nprogress/nprogress'; // importing a css file from the nprogress node module
```
> **Tip:** You can opt into using this feature with [CSS modules](/docs/adding-a-css-modules-stylesheet) too!
> **Note:** You must prefix imports from `node_modules` with `~` as displayed above.
---
id: adding-a-stylesheet
title: Adding A Stylesheet
sidebar_label: Adding Stylesheets
---
This project setup uses [Webpack](https://webpack.js.org/) for handling all assets. Webpack offers a custom way of “extending” the concept of `import` beyond JavaScript. To express that a JavaScript file depends on a CSS file, you need to **import the CSS from the JavaScript file**:
## `Button.css`
```css
.Button {
padding: 20px;
}
```
## `Button.js`
```js
import React, { Component } from 'react';
import './Button.css'; // Tell Webpack that Button.js uses these styles
class Button extends Component {
render() {
// You can use them as regular CSS styles
return <div className="Button" />;
}
}
```
**This is not required for React** but many people find this feature convenient. You can read about the benefits of this approach [here](https://medium.com/seek-blog/block-element-modifying-your-javascript-components-d7f99fcab52b). However you should be aware that this makes your code less portable to other build tools and environments than Webpack.
In development, expressing dependencies this way allows your styles to be reloaded on the fly as you edit them. In production, all CSS files will be concatenated into a single minified `.css` file in the build output.
If you are concerned about using Webpack-specific semantics, you can put all your CSS right into `src/index.css`. It would still be imported from `src/index.js`, but you could always remove that import if you later migrate to a different build tool.
---
id: adding-bootstrap
title: Adding Bootstrap
---
You don’t have to use [reactstrap](https://reactstrap.github.io/) together with React but it is a popular library for integrating Bootstrap with React apps. If you need it, you can integrate it with Create React App by following these steps:
Install reactstrap and Bootstrap from npm. reactstrap does not include Bootstrap CSS so this needs to be installed as well:
```sh
npm install --save reactstrap bootstrap@4
```
Alternatively you may use `yarn`:
```sh
yarn add bootstrap@4 reactstrap
```
Import Bootstrap CSS and optionally Bootstrap theme CSS in the beginning of your `src/index.js` file:
```js
import 'bootstrap/dist/css/bootstrap.css';
// Put any other imports below so that CSS from your
// components takes precedence over default styles.
```
Import required reactstrap components within `src/App.js` file or your custom component files:
```js
import { Button } from 'reactstrap';
```
Now you are ready to use the imported reactstrap components within your component hierarchy defined in the render method. Here is an example [`App.js`](https://gist.githubusercontent.com/zx6658/d9f128cd57ca69e583ea2b5fea074238/raw/a56701c142d0c622eb6c20a457fbc01d708cb485/App.js) redone using reactstrap.
## Using a Custom Theme
> Note: this feature is available with `react-scripts@2.0.0` and higher.
Sometimes you might need to tweak the visual styles of Bootstrap (or equivalent package).<br>
As of `react-scripts@2.0.0` you can import `.scss` files. This makes it possible to use a package's built-in Sass variables for global style preferences.
To customize Bootstrap, create a file called `src/custom.scss` (or similar) and import the Bootstrap source stylesheet. Add any overrides _before_ the imported file(s). You can reference [Bootstrap's documentation](http://getbootstrap.com/docs/4.1/getting-started/theming/#css-variables) for the names of the available variables.
```scss
// Override default variables before the import
$body-bg: #000;
// Import Bootstrap and its default variables
@import '~bootstrap/scss/bootstrap.scss';
```
> **Note:** You must prefix imports from `node_modules` with `~` as displayed above.
Finally, import the newly created `.scss` file instead of the default Bootstrap `.css` in the beginning of your `src/index.js` file, for example:
```javascript
import './custom.scss';
```
---
id: adding-custom-environment-variables
title: Adding Custom Environment Variables
sidebar_label: Environment Variables
---
> Note: this feature is available with `react-scripts@0.2.3` and higher.
Your project can consume variables declared in your environment as if they were declared locally in your JS files. By
default you will have `NODE_ENV` defined for you, and any other environment variables starting with
`REACT_APP_`.
**The environment variables are embedded during the build time**. Since Create React App produces a static HTML/CSS/JS bundle, it can’t possibly read them at runtime. To read them at runtime, you would need to load HTML into memory on the server and replace placeholders in runtime, just like [described here](/docs/injecting-data-from-the-server-into-the-page). Alternatively you can rebuild the app on the server anytime you change them.
> Note: You must create custom environment variables beginning with `REACT_APP_`. Any other variables except `NODE_ENV` will be ignored to avoid accidentally [exposing a private key on the machine that could have the same name](https://github.com/facebook/create-react-app/issues/865#issuecomment-252199527). Changing any environment variables will require you to restart the development server if it is running.
These environment variables will be defined for you on `process.env`. For example, having an environment
variable named `REACT_APP_SECRET_CODE` will be exposed in your JS as `process.env.REACT_APP_SECRET_CODE`.
There is also a special built-in environment variable called `NODE_ENV`. You can read it from `process.env.NODE_ENV`. When you run `npm start`, it is always equal to `'development'`, when you run `npm test` it is always equal to `'test'`, and when you run `npm run build` to make a production bundle, it is always equal to `'production'`. **You cannot override `NODE_ENV` manually.** This prevents developers from accidentally deploying a slow development build to production.
These environment variables can be useful for displaying information conditionally based on where the project is
deployed or consuming sensitive data that lives outside of version control.
First, you need to have environment variables defined. For example, let’s say you wanted to consume a secret defined
in the environment inside a `<form>`:
```jsx
render() {
return (
<div>
<small>You are running this application in <b>{process.env.NODE_ENV}</b> mode.</small>
<form>
<input type="hidden" defaultValue={process.env.REACT_APP_SECRET_CODE} />
</form>
</div>
);
}
```
During the build, `process.env.REACT_APP_SECRET_CODE` will be replaced with the current value of the `REACT_APP_SECRET_CODE` environment variable. Remember that the `NODE_ENV` variable will be set for you automatically.
When you load the app in the browser and inspect the `<input>`, you will see its value set to `abcdef`, and the bold text will show the environment provided when using `npm start`:
```html
<div>
<small>You are running this application in <b>development</b> mode.</small>
<form>
<input type="hidden" value="abcdef" />
</form>
</div>
```
The above form is looking for a variable called `REACT_APP_SECRET_CODE` from the environment. In order to consume this
value, we need to have it defined in the environment. This can be done using two ways: either in your shell or in
a `.env` file. Both of these ways are described in the next few sections.
Having access to the `NODE_ENV` is also useful for performing actions conditionally:
```js
if (process.env.NODE_ENV !== 'production') {
analytics.disable();
}
```
When you compile the app with `npm run build`, the minification step will strip out this condition, and the resulting bundle will be smaller.
## Referencing Environment Variables in the HTML
> Note: this feature is available with `react-scripts@0.9.0` and higher.
You can also access the environment variables starting with `REACT_APP_` in the `public/index.html`. For example:
```html
<title>%REACT_APP_WEBSITE_NAME%</title>
```
Note that the caveats from the above section apply:
- Apart from a few built-in variables (`NODE_ENV` and `PUBLIC_URL`), variable names must start with `REACT_APP_` to work.
- The environment variables are injected at build time. If you need to inject them at runtime, [follow this approach instead](/docs/generating-dynamic-meta-tags-on-the-server).
## Adding Temporary Environment Variables In Your Shell
Defining environment variables can vary between OSes. It’s also important to know that this manner is temporary for the
life of the shell session.
### Windows (cmd.exe)
```cmd
set "REACT_APP_SECRET_CODE=abcdef" && npm start
```
(Note: Quotes around the variable assignment are required to avoid a trailing whitespace.)
### Windows (Powershell)
```Powershell
($env:REACT_APP_SECRET_CODE = "abcdef") -and (npm start)
```
### Linux, macOS (Bash)
```bash
REACT_APP_SECRET_CODE=abcdef npm start
```
## Adding Development Environment Variables In `.env`
> Note: this feature is available with `react-scripts@0.5.0` and higher.
To define permanent environment variables, create a file called `.env` in the root of your project:
```
REACT_APP_SECRET_CODE=abcdef
```
> Note: You must create custom environment variables beginning with `REACT_APP_`. Any other variables except `NODE_ENV` will be ignored to avoid [accidentally exposing a private key on the machine that could have the same name](https://github.com/facebook/create-react-app/issues/865#issuecomment-252199527). Changing any environment variables will require you to restart the development server if it is running.
`.env` files **should be** checked into source control (with the exclusion of `.env*.local`).
### What other `.env` files can be used?
> Note: this feature is **available with `react-scripts@1.0.0` and higher**.
- `.env`: Default.
- `.env.local`: Local overrides. **This file is loaded for all environments except test.**
- `.env.development`, `.env.test`, `.env.production`: Environment-specific settings.
- `.env.development.local`, `.env.test.local`, `.env.production.local`: Local overrides of environment-specific settings.
Files on the left have more priority than files on the right:
- `npm start`: `.env.development.local`, `.env.development`, `.env.local`, `.env`
- `npm run build`: `.env.production.local`, `.env.production`, `.env.local`, `.env`
- `npm test`: `.env.test.local`, `.env.test`, `.env` (note `.env.local` is missing)
These variables will act as the defaults if the machine does not explicitly set them.<br>
Please refer to the [dotenv documentation](https://github.com/motdotla/dotenv) for more details.
> Note: If you are defining environment variables for development, your CI and/or hosting platform will most likely need
> these defined as well. Consult their documentation how to do this. For example, see the documentation for [Travis CI](https://docs.travis-ci.com/user/environment-variables/) or [Heroku](https://devcenter.heroku.com/articles/config-vars).
### Expanding Environment Variables In `.env`
> Note: this feature is available with `react-scripts@1.1.0` and higher.
Expand variables already on your machine for use in your `.env` file (using [dotenv-expand](https://github.com/motdotla/dotenv-expand)).
For example, to get the environment variable `npm_package_version`:
```
REACT_APP_VERSION=$npm_package_version
# also works:
# REACT_APP_VERSION=${npm_package_version}
```
Or expand variables local to the current `.env` file:
```
DOMAIN=www.example.com
REACT_APP_FOO=$DOMAIN/foo
REACT_APP_BAR=$DOMAIN/bar
```
---
id: adding-flow
title: Adding Flow
---
Flow is a static type checker that helps you write code with fewer bugs. Check out this [introduction to using static types in JavaScript](https://medium.com/@preethikasireddy/why-use-static-types-in-javascript-part-1-8382da1e0adb) if you are new to this concept.
Recent versions of [Flow](https://flow.org/) work with Create React App projects out of the box.
To add Flow to a Create React App project, follow these steps:
1. Run `npm install --save flow-bin` (or `yarn add flow-bin`).
2. Add `"flow": "flow"` to the `scripts` section of your `package.json`.
3. Run `npm run flow init` (or `yarn flow init`) to create a [`.flowconfig` file](https://flow.org/en/docs/config/) in the root directory.
4. Add `// @flow` to any files you want to type check (for example, to `src/App.js`).
Now you can run `npm run flow` (or `yarn flow`) to check the files for type errors.
You can optionally use an IDE like [Nuclide](https://nuclide.io/docs/languages/flow/) for a better integrated experience.
In the future we plan to integrate it into Create React App even more closely.
To learn more about Flow, check out [its documentation](https://flow.org/).
---
id: adding-images-fonts-and-files
title: Adding Images, Fonts, And Files
---
With Webpack, using static assets like images and fonts works similarly to CSS.
You can **`import` a file right in a JavaScript module**. This tells Webpack to include that file in the bundle. Unlike CSS imports, importing a file gives you a string value. This value is the final path you can reference in your code, e.g. as the `src` attribute of an image or the `href` of a link to a PDF.
To reduce the number of requests to the server, importing images that are less than 10,000 bytes returns a [data URI](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs) instead of a path. This applies to the following file extensions: bmp, gif, jpg, jpeg, and png. SVG files are excluded due to [#1153](https://github.com/facebook/create-react-app/issues/1153).
Here is an example:
```js
import React from 'react';
import logo from './logo.png'; // Tell Webpack this JS file uses this image
console.log(logo); // /logo.84287d09.png
function Header() {
// Import result is the URL of your image
return <img src={logo} alt="Logo" />;
}
export default Header;
```
This ensures that when the project is built, Webpack will correctly move the images into the build folder, and provide us with correct paths.
This works in CSS too:
```css
.Logo {
background-image: url(./logo.png);
}
```
Webpack finds all relative module references in CSS (they start with `./`) and replaces them with the final paths from the compiled bundle. If you make a typo or accidentally delete an important file, you will see a compilation error, just like when you import a non-existent JavaScript module. The final filenames in the compiled bundle are generated by Webpack from content hashes. If the file content changes in the future, Webpack will give it a different name in production so you don’t need to worry about long-term caching of assets.
Please be advised that this is also a custom feature of Webpack.
**It is not required for React** but many people enjoy it (and React Native uses a similar mechanism for images).<br>
An alternative way of handling static assets is described in the next section.
## Adding SVGs
> Note: this feature is available with `react-scripts@2.0.0` and higher.
One way to add SVG files was described in the section above. You can also import SVGs directly as React components. You can use either of the two approaches. In your code it would look like this:
```js
import { ReactComponent as Logo } from './logo.svg';
const App = () => (
<div>
{/* Logo is an actual React component */}
<Logo />
</div>
);
```
This is handy if you don't want to load SVG as a separate file. Don't forget the curly braces in the import! The `ReactComponent` import name is special and tells Create React App that you want a React component that renders an SVG, rather than its filename.
---
id: adding-relay
title: Adding Relay
---
Relay is a framework for building data-driven React applications powered by GraphQL. The current release candidate of Relay works with Create React App projects out of the box using Babel Macros. Simply set up your project as laid out in the [Relay documentation](https://facebook.github.io/relay/), then make sure you have a version of the babel plugin providing the macro.
To add it, run:
```sh
npm install --save --dev babel-plugin-relay@dev
```
Alternatively you may use `yarn`:
```sh
yarn upgrade babel-plugin-relay@dev
```
Then, wherever you use the `graphql` template tag, import the macro:
```js
import graphql from 'babel-plugin-relay/macro';
// instead of:
// import { graphql } from "babel-plugin-relay"
graphql`
query UserQuery {
viewer {
id
}
}
`;
```
To learn more about Relay, check out [its documentation](https://facebook.github.io/relay/).
---
id: advanced-configuration
title: Advanced Configuration
---
You can adjust various development and production settings by setting environment variables in your shell or with [.env](/docs/adding-development-environment-variables-in-env).
| Variable | Development | Production | Usage |
| :------------------ | :--------------------: | :----------------: | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| BROWSER | :white_check_mark: | :x: | By default, Create React App will open the default system browser, favoring Chrome on macOS. Specify a [browser](https://github.com/sindresorhus/opn#app) to override this behavior, or set it to `none` to disable it completely. If you need to customize the way the browser is launched, you can specify a node script instead. Any arguments passed to `npm start` will also be passed to this script, and the url where your app is served will be the last argument. Your script's file name must have the `.js` extension. |
| HOST | :white_check_mark: | :x: | By default, the development web server binds to `localhost`. You may use this variable to specify a different host. |
| PORT | :white_check_mark: | :x: | By default, the development web server will attempt to listen on port 3000 or prompt you to attempt the next available port. You may use this variable to specify a different port. |
| HTTPS | :white_check_mark: | :x: | When set to `true`, Create React App will run the development server in `https` mode. |
| PUBLIC_URL | :x: | :white_check_mark: | Create React App assumes your application is hosted at the serving web server's root or a subpath as specified in [`package.json` (`homepage`)](/docs/deployment#building-for-relative-paths). Normally, Create React App ignores the hostname. You may use this variable to force assets to be referenced verbatim to the url you provide (hostname included). This may be particularly useful when using a CDN to host your application. |
| CI | :large_orange_diamond: | :white_check_mark: | When set to `true`, Create React App treats warnings as failures in the build. It also makes the test runner non-watching. Most CIs set this flag by default. |
| REACT_EDITOR | :white_check_mark: | :x: | When an app crashes in development, you will see an error overlay with clickable stack trace. When you click on it, Create React App will try to determine the editor you are using based on currently running processes, and open the relevant source file. You can [send a pull request to detect your editor of choice](https://github.com/facebook/create-react-app/issues/2636). Setting this environment variable overrides the automatic detection. If you do it, make sure your systems [PATH](<https://en.wikipedia.org/wiki/PATH_(variable)>) environment variable points to your editor’s bin folder. You can also set it to `none` to disable it completely. |
| CHOKIDAR_USEPOLLING | :white_check_mark: | :x: | When set to `true`, the watcher runs in polling mode, as necessary inside a VM. Use this option if `npm start` isn't detecting changes. |
| GENERATE_SOURCEMAP | :x: | :white_check_mark: | When set to `false`, source maps are not generated for a production build. This solves OOM issues on some smaller machines. |
| NODE_PATH | :white_check_mark: | :white_check_mark: | Same as [`NODE_PATH` in Node.js](https://nodejs.org/api/modules.html#modules_loading_from_the_global_folders), but only relative folders are allowed. Can be handy for emulating a monorepo setup by setting `NODE_PATH=src`. |
---
id: alternatives-to-ejecting
title: Alternatives To Ejecting
---
[Ejecting](/docs/available-scripts#npm-run-eject) lets you customize anything, but from that point on you have to maintain the configuration and scripts yourself. This can be daunting if you have many similar projects. In such cases instead of ejecting we recommend to _fork_ `react-scripts` and any other packages you need. [This article](https://auth0.com/blog/how-to-configure-create-react-app/) dives into how to do it in depth. You can find more discussion in [this issue](https://github.com/facebook/create-react-app/issues/682).
---
id: analyzing-the-bundle-size
title: Analyzing the Bundle Size
sidebar_label: Analyzing Bundle Size
---
[Source map explorer](https://www.npmjs.com/package/source-map-explorer) analyzes
JavaScript bundles using the source maps. This helps you understand where code
bloat is coming from.
To add Source map explorer to a Create React App project, follow these steps:
```sh
npm install --save source-map-explorer
```
Alternatively you may use `yarn`:
```sh
yarn add source-map-explorer
```
Then in `package.json`, add the following line to `scripts`:
```diff
"scripts": {
+ "analyze": "source-map-explorer build/static/js/main.*",
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
```
Then to analyze the bundle run the production build then run the analyze
script.
```
npm run build
npm run analyze
```
---
id: available-scripts
title: Available Scripts
sidebar_label: Available Scripts
---
In the project directory, you can run:
## `npm start`
Runs the app in the development mode. Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
The page will reload if you make edits. You will also see any lint errors in the console.
## `npm test`
Launches the test runner in the interactive watch mode. See the section about [running tests](/docs/running-tests) for more information.
## `npm run build`
Builds the app for production to the `build` folder. It correctly bundles React in production mode and optimizes the build for the best performance.
The build is minified and the filenames include the hashes. Your app is ready to be deployed!
See the section about [deployment](/docs/deployment) for more information.
## `npm run eject`
**Note: this is a one-way operation. Once you `eject`, you can’t go back!**
If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.
Instead, it will copy all the configuration files and the transitive dependencies (Webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.
You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.
---
id: can-i-use-decorators
title: Can I Use Decorators?
---
Some popular libraries use [decorators](https://medium.com/google-developers/exploring-es7-decorators-76ecb65fb841) in their documentation.<br>
Create React App intentionally doesn’t support decorator syntax at the moment because:
- It is an experimental proposal and is subject to change (in fact, it has already changed once, and will change again).
- Most libraries currently support only the old version of the proposal — which will never be a standard.
However in many cases you can rewrite decorator-based code without decorators just as fine.<br>
Please refer to these two threads for reference:
- [#214](https://github.com/facebook/create-react-app/issues/214)
- [#411](https://github.com/facebook/create-react-app/issues/411)
Create React App will add decorator support when the specification advances to a stable stage.
---
id: code-splitting
title: Code Splitting
---
Instead of downloading the entire app before users can use it, code splitting allows you to split your code into small chunks which you can then load on demand.
This project setup supports code splitting via [dynamic `import()`](http://2ality.com/2017/01/import-operator.html#loading-code-on-demand). Its [proposal](https://github.com/tc39/proposal-dynamic-import) is in stage 3. The `import()` function-like form takes the module name as an argument and returns a [`Promise`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) which always resolves to the namespace object of the module.
Here is an example:
## `moduleA.js`
```js
const moduleA = 'Hello';
export { moduleA };
```
## `App.js`
```js
import React, { Component } from 'react';
class App extends Component {
handleClick = () => {
import('./moduleA')
.then(({ moduleA }) => {
// Use moduleA
})
.catch(err => {
// Handle failure
});
};
render() {
return (
<div>
<button onClick={this.handleClick}>Load</button>
</div>
);
}
}
export default App;
```
This will make `moduleA.js` and all its unique dependencies as a separate chunk that only loads after the user clicks the 'Load' button.
You can also use it with `async` / `await` syntax if you prefer it.
## With React Router
If you are using React Router check out [this tutorial](http://serverless-stack.com/chapters/code-splitting-in-create-react-app.html) on how to use code splitting with it. You can find the companion GitHub repository [here](https://github.com/AnomalyInnovations/serverless-stack-demo-client/tree/code-splitting-in-create-react-app).
Also check out the [Code Splitting](https://reactjs.org/docs/code-splitting.html) section in React documentation.
---
id: debugging-tests
title: Debugging Tests
sidebar_label: Debugging Tests
---
There are various ways to setup a debugger for your Jest tests. We cover debugging in Chrome and [Visual Studio Code](https://code.visualstudio.com/).
> Note: debugging tests requires Node 8 or higher.
## Debugging Tests in Chrome
Add the following to the `scripts` section in your project's `package.json`
```json
"scripts": {
"test:debug": "react-scripts --inspect-brk test --runInBand"
}
```
Place `debugger;` statements in any test and run:
```bash
$ npm run test:debug
```
This will start running your Jest tests, but pause before executing to allow a debugger to attach to the process.
Open the following in Chrome
```
about:inspect
```
After opening that link, the Chrome Developer Tools will be displayed. Select `inspect` on your process and a breakpoint will be set at the first line of the react script (this is done simply to give you time to open the developer tools and to prevent Jest from executing before you have time to do so). Click the button that looks like a "play" button in the upper right hand side of the screen to continue execution. When Jest executes the test that contains the debugger statement, execution will pause and you can examine the current scope and call stack.
> Note: the --runInBand cli option makes sure Jest runs test in the same process rather than spawning processes for individual tests. Normally Jest parallelizes test runs across processes but it is hard to debug many processes at the same time.
## Debugging Tests in Visual Studio Code
Debugging Jest tests is supported out of the box for [Visual Studio Code](https://code.visualstudio.com).
Use the following [`launch.json`](https://code.visualstudio.com/docs/editor/debugging#_launch-configurations) configuration file:
```
{
"version": "0.2.0",
"configurations": [
{
"name": "Debug CRA Tests",
"type": "node",
"request": "launch",
"runtimeExecutable": "${workspaceRoot}/node_modules/.bin/react-scripts",
"args": [
"test",
"--runInBand",
"--no-cache"
],
"cwd": "${workspaceRoot}",
"protocol": "inspector",
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen"
}
]
}
```
---
id: deployment
title: Deployment
sidebar_label: Deployment
---
`npm run build` creates a `build` directory with a production build of your app. Set up your favorite HTTP server so that a visitor to your site is served `index.html`, and requests to static paths like `/static/js/main.<hash>.js` are served with the contents of the `/static/js/main.<hash>.js` file.
## Static Server
For environments using [Node](https://nodejs.org/), the easiest way to handle this would be to install [serve](https://github.com/zeit/serve) and let it handle the rest:
```sh
npm install -g serve
serve -s build
```
The last command shown above will serve your static site on the port **5000**. Like many of [serve](https://github.com/zeit/serve)’s internal settings, the port can be adjusted using the `-p` or `--port` flags.
Run this command to get a full list of the options available:
```sh
serve -h
```
## Other Solutions
You don’t necessarily need a static server in order to run a Create React App project in production. It works just as fine integrated into an existing dynamic one.
Here’s a programmatic example using [Node](https://nodejs.org/) and [Express](http://expressjs.com/):
```javascript
const express = require('express');
const path = require('path');
const app = express();
app.use(express.static(path.join(__dirname, 'build')));
app.get('/', function(req, res) {
res.sendFile(path.join(__dirname, 'build', 'index.html'));
});
app.listen(9000);
```
The choice of your server software isn’t important either. Since Create React App is completely platform-agnostic, there’s no need to explicitly use Node.
The `build` folder with static assets is the only output produced by Create React App.
However this is not quite enough if you use client-side routing. Read the next section if you want to support URLs like `/todos/42` in your single-page app.
## Serving Apps with Client-Side Routing
If you use routers that use the HTML5 [`pushState` history API](https://developer.mozilla.org/en-US/docs/Web/API/History_API#Adding_and_modifying_history_entries) under the hood (for example, [React Router](https://github.com/ReactTraining/react-router) with `browserHistory`), many static file servers will fail. For example, if you used React Router with a route for `/todos/42`, the development server will respond to `localhost:3000/todos/42` properly, but an Express serving a production build as above will not.
This is because when there is a fresh page load for a `/todos/42`, the server looks for the file `build/todos/42` and does not find it. The server needs to be configured to respond to a request to `/todos/42` by serving `index.html`. For example, we can amend our Express example above to serve `index.html` for any unknown paths:
```diff
app.use(express.static(path.join(__dirname, 'build')));
-app.get('/', function (req, res) {
+app.get('/*', function (req, res) {
res.sendFile(path.join(__dirname, 'build', 'index.html'));
});
```
If you’re using [Apache HTTP Server](https://httpd.apache.org/), you need to create a `.htaccess` file in the `public` folder that looks like this:
```
Options -MultiViews
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.html [QSA,L]
```
It will get copied to the `build` folder when you run `npm run build`.
If you’re using [Apache Tomcat](http://tomcat.apache.org/), you need to follow [this Stack Overflow answer](https://stackoverflow.com/a/41249464/4878474).
Now requests to `/todos/42` will be handled correctly both in development and in production.
On a production build, and when you've [opted-in](/docs/making-a-progressive-web-app#why-opt-in),
a [service worker](https://developers.google.com/web/fundamentals/primers/service-workers/) will automatically handle all navigation requests, like for
`/todos/42`, by serving the cached copy of your `index.html`. This
service worker navigation routing can be configured or disabled by
[`eject`ing](/docs/available-scripts#npm-run-eject) and then modifying the
[`navigateFallback`](https://github.com/GoogleChrome/sw-precache#navigatefallback-string)
and [`navigateFallbackWhitelist`](https://github.com/GoogleChrome/sw-precache#navigatefallbackwhitelist-arrayregexp)
options of the `SWPreachePlugin` [configuration](../config/webpack.config.prod.js).
When users install your app to the homescreen of their device the default configuration will make a shortcut to `/index.html`. This may not work for client-side routers which expect the app to be served from `/`. Edit the web app manifest at [`public/manifest.json`](public/manifest.json) and change `start_url` to match the required URL scheme, for example:
```js
"start_url": ".",
```
## Building for Relative Paths
By default, Create React App produces a build assuming your app is hosted at the server root.<br>
To override this, specify the `homepage` in your `package.json`, for example:
```js
"homepage": "http://mywebsite.com/relativepath",
```
This will let Create React App correctly infer the root path to use in the generated HTML file.
**Note**: If you are using `react-router@^4`, you can root `<Link>`s using the `basename` prop on any `<Router>`.<br>
More information [here](https://reacttraining.com/react-router/web/api/BrowserRouter/basename-string).<br>
<br>
For example:
```js
<BrowserRouter basename="/calendar"/>
<Link to="/today"/> // renders <a href="/calendar/today">
```
### Serving the Same Build from Different Paths
> Note: this feature is available with `react-scripts@0.9.0` and higher.
If you are not using the HTML5 `pushState` history API or not using client-side routing at all, it is unnecessary to specify the URL from which your app will be served. Instead, you can put this in your `package.json`:
```js
"homepage": ".",
```
This will make sure that all the asset paths are relative to `index.html`. You will then be able to move your app from `http://mywebsite.com` to `http://mywebsite.com/relativepath` or even `http://mywebsite.com/relative/path` without having to rebuild it.
## Customizing Environment Variables for Arbitrary Build Environments
You can create an arbitrary build environment by creating a custom `.env` file and loading it using [env-cmd](https://www.npmjs.com/package/env-cmd).
For example, to create a build environment for a staging environment:
1. Create a file called `.env.staging`
1. Set environment variables as you would any other `.env` file (e.g. `REACT_APP_API_URL=http://api-staging.example.com`)
1. Install [env-cmd](https://www.npmjs.com/package/env-cmd)
```sh
$ npm install env-cmd --save
$ # or
$ yarn add env-cmd
```
1. Add a new script to your `package.json`, building with your new environment:
```json
{
"scripts": {
"build:staging": "env-cmd .env.staging npm run build"
}
}
```
Now you can run `npm run build:staging` to build with the staging environment config.
You can specify other environments in the same way.
Variables in `.env.production` will be used as fallback because `NODE_ENV` will always be set to `production` for a build.
## [Azure](https://azure.microsoft.com/)
See [this](https://medium.com/@to_pe/deploying-create-react-app-on-microsoft-azure-c0f6686a4321) blog post on how to deploy your React app to Microsoft Azure.
See [this](https://medium.com/@strid/host-create-react-app-on-azure-986bc40d5bf2#.pycfnafbg) blog post or [this](https://github.com/ulrikaugustsson/azure-appservice-static) repo for a way to use automatic deployment to Azure App Service.
## [Firebase](https://firebase.google.com/)
Install the Firebase CLI if you haven’t already by running `npm install -g firebase-tools`. Sign up for a [Firebase account](https://console.firebase.google.com/) and create a new project. Run `firebase login` and login with your previous created Firebase account.
Then run the `firebase init` command from your project’s root. You need to choose the **Hosting: Configure and deploy Firebase Hosting sites** and choose the Firebase project you created in the previous step. You will need to agree with `database.rules.json` being created, choose `build` as the public directory, and also agree to **Configure as a single-page app** by replying with `y`.
```sh
=== Project Setup
First, let's associate this project directory with a Firebase project.
You can create multiple project aliases by running firebase use --add,
but for now we'll just set up a default project.
? What Firebase project do you want to associate as default? Example app (example-app-fd690)
=== Database Setup
Firebase Realtime Database Rules allow you to define how your data should be
structured and when your data can be read from and written to.
? What file should be used for Database Rules? database.rules.json
✔ Database Rules for example-app-fd690 have been downloaded to database.rules.json.
Future modifications to database.rules.json will update Database Rules when you run
firebase deploy.
=== Hosting Setup
Your public directory is the folder (relative to your project directory) that
will contain Hosting assets to uploaded with firebase deploy. If you
have a build process for your assets, use your build's output directory.
? What do you want to use as your public directory? build
? Configure as a single-page app (rewrite all urls to /index.html)? Yes
✔ Wrote build/index.html
i Writing configuration info to firebase.json...
i Writing project information to .firebaserc...
✔ Firebase initialization complete!
```
IMPORTANT: you need to set proper HTTP caching headers for `service-worker.js` file in `firebase.json` file or you will not be able to see changes after first deployment ([issue #2440](https://github.com/facebook/create-react-app/issues/2440)). It should be added inside `"hosting"` key like next:
```
{
"hosting": {
...
"headers": [
{"source": "/service-worker.js", "headers": [{"key": "Cache-Control", "value": "no-cache"}]}
]
...
```
Now, after you create a production build with `npm run build`, you can deploy it by running `firebase deploy`.
```sh
=== Deploying to 'example-app-fd690'...
i deploying database, hosting
✔ database: rules ready to deploy.
i hosting: preparing build directory for upload...
Uploading: [============================== ] 75%✔ hosting: build folder uploaded successfully
✔ hosting: 8 files uploaded successfully
i starting release process (may take several minutes)...
✔ Deploy complete!
Project Console: https://console.firebase.google.com/project/example-app-fd690/overview
Hosting URL: https://example-app-fd690.firebaseapp.com
```
For more information see [Add Firebase to your JavaScript Project](https://firebase.google.com/docs/web/setup).
## [GitHub Pages](https://pages.github.com/)
> Note: this feature is available with `react-scripts@0.2.0` and higher.
### Step 1: Add `homepage` to `package.json`
**The step below is important!**<br>
**If you skip it, your app will not deploy correctly.**
Open your `package.json` and add a `homepage` field for your project:
```json
"homepage": "https://myusername.github.io/my-app",
```
or for a GitHub user page:
```json
"homepage": "https://myusername.github.io",
```
or for a custom domain page:
```json
"homepage": "https://mywebsite.com",
```
Create React App uses the `homepage` field to determine the root URL in the built HTML file.
### Step 2: Install `gh-pages` and add `deploy` to `scripts` in `package.json`
Now, whenever you run `npm run build`, you will see a cheat sheet with instructions on how to deploy to GitHub Pages.
To publish it at [https://myusername.github.io/my-app](https://myusername.github.io/my-app), run:
```sh
npm install --save gh-pages
```
Alternatively you may use `yarn`:
```sh
yarn add gh-pages
```
Add the following scripts in your `package.json`:
```diff
"scripts": {
+ "predeploy": "npm run build",
+ "deploy": "gh-pages -d build",
"start": "react-scripts start",
"build": "react-scripts build",
```
The `predeploy` script will run automatically before `deploy` is run.
If you are deploying to a GitHub user page instead of a project page you'll need to make two
additional modifications:
1. First, change your repository's source branch to be any branch other than **master**.
1. Additionally, tweak your `package.json` scripts to push deployments to **master**:
```diff
"scripts": {
"predeploy": "npm run build",
- "deploy": "gh-pages -d build",
+ "deploy": "gh-pages -b master -d build",
```
### Step 3: Deploy the site by running `npm run deploy`
Then run:
```sh
npm run deploy
```
### Step 4: Ensure your project’s settings use `gh-pages`
Finally, make sure **GitHub Pages** option in your GitHub project settings is set to use the `gh-pages` branch:
<img src="http://i.imgur.com/HUjEr9l.png" width="500" alt="gh-pages branch setting">
### Step 5: Optionally, configure the domain
You can configure a custom domain with GitHub Pages by adding a `CNAME` file to the `public/` folder.
Your CNAME file should look like this:
```
mywebsite.com
```
### Notes on client-side routing
GitHub Pages doesn’t support routers that use the HTML5 `pushState` history API under the hood (for example, React Router using `browserHistory`). This is because when there is a fresh page load for a url like `http://user.github.io/todomvc/todos/42`, where `/todos/42` is a frontend route, the GitHub Pages server returns 404 because it knows nothing of `/todos/42`. If you want to add a router to a project hosted on GitHub Pages, here are a couple of solutions:
- You could switch from using HTML5 history API to routing with hashes. If you use React Router, you can switch to `hashHistory` for this effect, but the URL will be longer and more verbose (for example, `http://user.github.io/todomvc/#/todos/42?_k=yknaj`). [Read more](https://reacttraining.com/react-router/web/api/Router) about different history implementations in React Router.
- Alternatively, you can use a trick to teach GitHub Pages to handle 404 by redirecting to your `index.html` page with a special redirect parameter. You would need to add a `404.html` file with the redirection code to the `build` folder before deploying your project, and you’ll need to add code handling the redirect parameter to `index.html`. You can find a detailed explanation of this technique [in this guide](https://github.com/rafrex/spa-github-pages).
### Troubleshooting
#### "/dev/tty: No such a device or address"
If, when deploying, you get `/dev/tty: No such a device or address` or a similar error, try the following:
1. Create a new [Personal Access Token](https://github.com/settings/tokens)
2. `git remote set-url origin https://<user>:<token>@github.com/<user>/<repo>` .
3. Try `npm run deploy` again
#### "Cannot read property 'email' of null"
If, when deploying, you get `Cannot read property 'email' of null`, try the following:
1. `git config --global user.name '<your_name>'`
2. `git config --global user.email '<your_email>'`
3. Try `npm run deploy` again
## [Heroku](https://www.heroku.com/)
Use the [Heroku Buildpack for Create React App](https://github.com/mars/create-react-app-buildpack).<br>
You can find instructions in [Deploying React with Zero Configuration](https://blog.heroku.com/deploying-react-with-zero-configuration).
### Resolving Heroku Deployment Errors
Sometimes `npm run build` works locally but fails during deploy via Heroku. Following are the most common cases.
#### "Module not found: Error: Cannot resolve 'file' or 'directory'"
If you get something like this:
```
remote: Failed to create a production build. Reason:
remote: Module not found: Error: Cannot resolve 'file' or 'directory'
MyDirectory in /tmp/build_1234/src
```
It means you need to ensure that the lettercase of the file or directory you `import` matches the one you see on your filesystem or on GitHub.
This is important because Linux (the operating system used by Heroku) is case sensitive. So `MyDirectory` and `mydirectory` are two distinct directories and thus, even though the project builds locally, the difference in case breaks the `import` statements on Heroku remotes.
#### "Could not find a required file."
If you exclude or ignore necessary files from the package you will see a error similar this one:
```
remote: Could not find a required file.
remote: Name: `index.html`
remote: Searched in: /tmp/build_a2875fc163b209225122d68916f1d4df/public
remote:
remote: npm ERR! Linux 3.13.0-105-generic
remote: npm ERR! argv "/tmp/build_a2875fc163b209225122d68916f1d4df/.heroku/node/bin/node" "/tmp/build_a2875fc163b209225122d68916f1d4df/.heroku/node/bin/npm" "run" "build"
```
In this case, ensure that the file is there with the proper lettercase and that’s not ignored on your local `.gitignore` or `~/.gitignore_global`.
## [Netlify](https://www.netlify.com/)
**To do a manual deploy to Netlify’s CDN:**
```sh
npm install netlify-cli -g
netlify deploy
```
Choose `build` as the path to deploy.
**To setup continuous delivery:**
With this setup Netlify will build and deploy when you push to git or open a pull request:
1. [Start a new netlify project](https://app.netlify.com/signup)
2. Pick your Git hosting service and select your repository
3. Click `Build your site`
**Support for client-side routing:**
To support `pushState`, make sure to create a `public/_redirects` file with the following rewrite rules:
```
/* /index.html 200
```
When you build the project, Create React App will place the `public` folder contents into the build output.
## [Now](https://zeit.co/now)
Now offers a zero-configuration single-command deployment. You can use `now` to deploy your app for free.
1. Install the `now` command-line tool either via the recommended [desktop tool](https://zeit.co/download) or via node with `npm install -g now`.
2. Build your app by running `npm run build`.
3. Move into the build directory by running `cd build`.
4. Run `now --name your-project-name` from within the build directory. You will see a **now.sh** URL in your output like this:
```
> Ready! https://your-project-name-tpspyhtdtk.now.sh (copied to clipboard)
```
Paste that URL into your browser when the build is complete, and you will see your deployed app.
Details are available in [this article.](https://zeit.co/blog/unlimited-static)
## [S3](https://aws.amazon.com/s3) and [CloudFront](https://aws.amazon.com/cloudfront/)
See this [blog post](https://medium.com/@omgwtfmarc/deploying-create-react-app-to-s3-or-cloudfront-48dae4ce0af) on how to deploy your React app to Amazon Web Services S3 and CloudFront.
## [Surge](https://surge.sh/)
Install the Surge CLI if you haven’t already by running `npm install -g surge`. Run the `surge` command and log in you or create a new account.
When asked about the project path, make sure to specify the `build` folder, for example:
```sh
project path: /path/to/project/build
```
Note that in order to support routers that use HTML5 `pushState` API, you may want to rename the `index.html` in your build folder to `200.html` before deploying to Surge. This [ensures that every URL falls back to that file](https://surge.sh/help/adding-a-200-page-for-client-side-routing).
## Publishing Components To npm
Create React App doesn't provide any built-in functionality to publish a component to npm. If you're ready to extract a component from your project so other people can use it, we recommend moving it to a separate directory outside of your project and then using a tool like [nwb](https://github.com/insin/nwb#react-components-and-libraries) to prepare it for publishing.
---
id: developing-components-in-isolation
title: Developing Components In Isolation
---
Usually, in an app, you have a lot of UI components, and each of them has many different states.
For an example, a simple button component could have following states:
- In a regular state, with a text label.
- In the disabled mode.
- In a loading state.
Usually, it’s hard to see these states without running a sample app or some examples.
Create React App doesn’t include any tools for this by default, but you can easily add [Storybook for React](https://storybook.js.org) ([source](https://github.com/storybooks/storybook)) or [React Styleguidist](https://react-styleguidist.js.org/) ([source](https://github.com/styleguidist/react-styleguidist)) to your project. **These are third-party tools that let you develop components and see all their states in isolation from your app**.
![Storybook for React Demo](http://i.imgur.com/7CIAWpB.gif)
You can also deploy your Storybook or style guide as a static app. This way, everyone in your team can view and review different states of UI components without starting a backend server or creating an account in your app.
## Getting Started with Storybook
Storybook is a development environment for React UI components. It allows you to browse a component library, view the different states of each component, and interactively develop and test components.
First, install the following npm package globally:
```sh
npm install -g @storybook/cli
```
Then, run the following command inside your app’s directory:
```sh
getstorybook
```
After that, follow the instructions on the screen.
Learn more about React Storybook:
- [Learn Storybook (tutorial)](https://learnstorybook.com)
- [Documentation](https://storybook.js.org/basics/introduction/)
- [GitHub Repo](https://github.com/storybooks/storybook)
- [Snapshot Testing UI](https://github.com/storybooks/storybook/tree/master/addons/storyshots) with Storybook + addon/storyshot
## Getting Started with Styleguidist
Styleguidist combines a style guide, where all your components are presented on a single page with their props documentation and usage examples, with an environment for developing components in isolation, similar to Storybook. In Styleguidist you write examples in Markdown, where each code snippet is rendered as a live editable playground.
First, install Styleguidist:
```sh
npm install --save react-styleguidist
```
Alternatively you may use `yarn`:
```sh
yarn add react-styleguidist
```
Then, add these scripts to your `package.json`:
```diff
"scripts": {
+ "styleguide": "styleguidist server",
+ "styleguide:build": "styleguidist build",
"start": "react-scripts start",
```
Then, run the following command inside your app’s directory:
```sh
npm run styleguide
```
After that, follow the instructions on the screen.
Learn more about React Styleguidist:
- [GitHub Repo](https://github.com/styleguidist/react-styleguidist)
- [Documentation](https://react-styleguidist.js.org/docs/getting-started.html)
---
id: documentation-intro
title: About The Docs
sidebar_label: About The Docs
---
Welcome to the documentation! Please navigate via the table of contents to find what you are looking for.
## Something Missing?
If you have ideas for more “How To” recipes that should be on this page, [let us know](https://github.com/facebook/create-react-app/issues) or [contribute some!](https://github.com/facebook/create-react-app/edit/master/packages/react-scripts/template/README.md)
## Feedback
We are always open to [your feedback](https://github.com/facebook/create-react-app/issues).
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment