<<<<<<< HEAD
=======
facebook/next
Create React apps (with Typescript) with no build configuration.
<<<<<<< HEAD
- Getting Started – How to create a new app.
- User Guide – How to develop apps bootstrapped with react scripts ts.
Do you know react and want to try out typescript? Or do you know typescript and want to try out react? Get all the benefits from create-react-app
but you use typescript! 🚀
- Creating an App – How to create a new app.
- User Guide – How to develop apps bootstrapped with Create React App.
Create React App works on macOS, Windows, and Linux.
If something doesn’t work, please file an issue.
facebook/next
npm install -g create-react-app
create-react-app my-app --scripts-version=react-scripts-ts
cd my-app/
npm start
<<<<<<< HEAD
======= (npx comes with npm 5.2+ and higher, see instructions for older npm versions)
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
.
facebook/next
In general, most upgrades won't require any migration steps to work, but if you experience problems after an upgrade, please file an issue, and we'll add it to the list of migration steps below.
Since 2.16.0
, the template uses different tsconfig
files for both development and production mode. For the latter, unfortunately, the path resolver is not smart enough to fall back to the basic tsconfig.json
in case the expected tsconfig.prod.json
is not present, so you have to create this file manually like shown here.
Since 2.13.0
, typescript
is listed as a peer dependency of react-scripts-ts
. For projects generated with at least this version, the init script takes care of properly installing it as dev dependency to the generated projects. Older projects require manual installation, in case you have not already done that.
Using npm
:
npm i -D typescript
Using yarn
:
yarn add -D typescript
<<<<<<< HEAD
Version 2.5.0
introduces a new config file for jest, that is necessary for the tests to run. If you were previously running a version older than v2.5.0
and upgraded to v2.5.0
or newer, you need to manually add the new file, or else you'll get an error similar to this when trying to run your tests:
Inside the newly created project, you can run some built-in commands:
Runs the app in development mode.
Open http://localhost:3000 to view it in the browser.
The page will automatically reload if you make changes to the code.
You will see the build errors and lint warnings in the console.
Runs the test watcher in an interactive mode.
By default, runs tests related to files changed since the last commit.
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.
By default, it also includes a service worker so that your app loads from local cache on future visits.
Your app is ready to be deployed.
The User Guide includes information on different topics, such as:
- Updating to New Releases
- Folder Structure
- Available Scripts
- Supported Browsers
- Supported Language Features and Polyfills
- Syntax Highlighting in the Editor
- Displaying Lint Output in the Editor
- Formatting Code Automatically
- Debugging in the Editor
- Changing the Page
<title>
- Installing a Dependency
- Importing a Component
- Code Splitting
- Adding a Stylesheet
- Post-Processing CSS
- Adding a CSS Preprocessor (Sass, Less etc.)
- Adding Images, Fonts, and Files
- Using the
public
Folder - Using Global Variables
- Adding Bootstrap
- Adding Flow
- Adding a Router
- Adding Custom Environment Variables
- Can I Use Decorators?
- Fetching Data with AJAX Requests
- Integrating with an API Backend
- Proxying API Requests in Development
- Using HTTPS in Development
- Generating Dynamic
<meta>
Tags on the Server - Pre-Rendering into Static HTML Files
- Running Tests
- Debugging Tests
- Developing Components in Isolation
- Publishing Components to npm
- Making a Progressive Web App
- Analyzing the Bundle Size
- Deployment
- Advanced Configuration
- Troubleshooting
facebook/next
Test suite failed to run
{
"messageText": "Cannot read file 'C:\\[project]\\tsconfig.test.json': ENOENT: no such file or directory, open 'C:\\[project]\\tsconfig.test.json'.",
"category": 1,
"code": 5012
}
<<<<<<< HEAD
To fix this, create a new file in the root of the project called tsconfig.test.json
, and paste the content of this file into it. Everything should work now. For more info, please see this issue.
Please refer to the User Guide for this and other information.
facebook/next
- Allow
moduleNameMapper
config override - @sebald - Fix travis build - @DorianGrey
- Allow using different tsconfig file for dev and build - @DorianGrey
- Fix duplicated mjs entry in Jest config - @StevenLangbroek
- Allow
--watchAll
to be set - @DorianGrey
- Replace TSLint rules with presets - @nielsdB97
- Update file-loader exclusion rules - @winstonewert
- Fix Uglifyjs settings - @meandmax
- Merge react-script 1.1.x - @wmonk
- README fixes - @kaminskypavel
- README fixes - @adambowles
- Remove unused JS files - @DorianGrey
- README fixes - @stephtr
- Added the abillity to import js and jsx files with ts-loader - @GeeWee
- Uglifyjs update for es6 support - @thetric
- Remove tslint-loader from prod builds - @DorianGrey
- Include typescript as devDependency in boilerplate - @ianschmitz
- Document custom module formats - @joshtynjala
- Fix tsconfig.json - @diabelb
<<<<<<< HEAD
- Update typescript to 2.6.2 =======
- React, JSX, ES6, and Flow syntax support.
- Language extras beyond ES6 like the object spread operator.
- Autoprefixed CSS, so you don’t need
-webkit-
or other prefixes. - A fast interactive unit test runner with built-in support for coverage reporting.
- A live development server that warns about common mistakes.
- A build script to bundle JS, CSS, and images for production, with hashes and sourcemaps.
- An offline-first service worker and a web app manifest, meeting all the Progressive Web App criteria.
- Hassle-free updates for the above tools with a single dependency.
facebook/next
- Upgrade to
react-scripts@1.0.17
<<<<<<< HEAD
- README updates - StefanSchoof
- README updates - DorianGrey
- Add support for fork-ts-checker-webpack-plugin - johnnyreilly ======= The tradeoff is that these tools are preconfigured to work in a specific way. If your project needs more customization, you can "eject" and customize it, but then you will need to maintain this configuration.
facebook/next
This included changes that were not published by the facebook upstream, so was unpublished.
- Update typescript to 2.5.3 - @nicolaserny
- Merge react-scripts@1.0.13 - @JohnNilsson
- Fix git tempalte - @hktonylee
- Provide migration docs - @JReinhold
- Updated dependencies - @swengorschewski
- Fix tslint config - @comerc
- Merge react-scripts@1.0.10 - @wmonk
- Update component template - @pelotom
- Support dynamic imports - thanks @nicolaserny, @DorianGrey
- Fix up tsconfig - thanks @js-n
- Fix readme typo - thanks @adambowles
- Move to ts-jest - thanks @DorianGrey
<<<<<<< HEAD
- Upgrade typescript to 2.4 and ts-loader to 2.2.1 - thanks @frederickfogerty
- Fix readme typo - thanks @wrongway4you =======
- If you need to integrate React code with a server-side template framework like Rails or Django, or if you’re not building a single-page app, consider using nwb, or Neutrino which are more flexible. For Rails specifically, you can use Rails Webpacker.
facebook/next
- Fix
typescript
version to 2.3.x until 2.4 @types are fixed
- All tsc to parse config (for
extend
) - Thanks to @DorianGrey - Fix various jest issues - thanks to @zinserjan
- Fix code coverage - thanks to @zinserjan
- Upgrade to
react-scripts@1.0.6
<<<<<<< HEAD
-
Update to
tslint@5.2.0
- thanks to @mindjuice -
Fix test setup issue - thanks to @jonmpqts
-
Add
source-map-loader
- thanks to @Place1 -
Update to
typescript@2.3.3
- thanks to @sjdweb ======= -
If you want to use Parcel instead of Webpack as your bundler, consider using create-react-app-parcel.
-
Finally, if you need more customization, check out Neutrino and its React preset.
facebook/next
- Fix issue with jest finding test files
- Upgrade to
react-scripts@1.x.x
- Upgrade to typescript@2.3.2 - thanks to @patrick91
- Add tests around react-scripts-ts - thanks to @migerh
- Upgrade to typescript@2.2.2 - thanks to @jeremistadler
- Fix regression where no
@types
were being installed on init
- Merge facebookincubator/create-react-app@0.9.5 into react-scripts-ts
- Merge facebookincubator/create-react-app@0.9.4 into react-scripts-ts
- Merge facebookincubator/create-react-app@0.9.3 into react-scripts-ts
- Merge facebookincubator/create-react-app@0.9.2 into react-scripts-ts
- Merge facebookincubator/create-react-app@0.9.1 into react-scripts-ts
- Merge facebookincubator/create-react-app@0.9.0 into react-scripts-ts
- Add missing
cli-highlight
dependency
- Print file names when running
npm run build
- Add support for
setupTest.ts
- Highlight source code when erroring in
npm run build
- Change mentions of
eslint
totslint
- Remove hidden character from
tsconfig.json
<<<<<<< HEAD
- Copy
typescriptTransform.js
when runningnpm run eject
======= - @eanplatter
- @insin
- @mxstbr
Create React App is open source software licensed as MIT.
facebook/next