zalbia / with-typescript-react-cosmos

A minimal example integrating next.js, typescript, and react-cosmos

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

TypeScript/Next.js/React Cosmos example

This is a simple project forking the next.js with-typescript example that shows the usage of Next.js with TypeScript and React Cosmos.

How to use it?

Install it and run:

npm install
npm run dev
npm run cosmos
# or
yarn
yarn dev
yarn cosmos

The idea behind the example

Use the @zeit/next-typescript plugin to inject the Webpack config required to compile TypeScript to JavaScript. For information about using a TSConfig have a look at the plugin page.

To get react-cosmos working, we create a webpack config separate from next.js and point cosmos.config.js to it.

About

A minimal example integrating next.js, typescript, and react-cosmos


Languages

Language:JavaScript 63.8%Language:TypeScript 36.2%