This is a simple project forking the next.js with-typescript example that shows the usage of Next.js with TypeScript and React Cosmos.
Install it and run:
npm install
npm run dev
npm run cosmos
# or
yarn
yarn dev
yarn cosmos
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.