Quickly publish Create React App with TypeScript to NPM.
Start in development mode at http://localhost:3000.
Build for production to /build
.
Package src/App.tsx
for publishing to /dist
.
-
Package for publishing with
yarn pack
. -
In package.json:
- Remove
"private": true
to allow public access. - Move
"react-scripts"
to"devDependencies"
. - Move
"react"
and"react-dom"
to"peerDependencies"
. - Add
"files": ["dist"]
to avoid ignoring. - Add
"main": "dist/App.js"
as the entry point. - Add
"types": "dist/App.d.ts"
as the type definitions.
- Remove
-
Release with
npm publish
.