Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/zalbia/with-typescript-react-cosmos
A minimal example integrating next.js, typescript, and react-cosmos
https://github.com/zalbia/with-typescript-react-cosmos
nextjs react react-cosmos typescript
Last synced: 7 days ago
JSON representation
A minimal example integrating next.js, typescript, and react-cosmos
- Host: GitHub
- URL: https://github.com/zalbia/with-typescript-react-cosmos
- Owner: zalbia
- Created: 2018-08-11T05:26:15.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-08-11T10:05:31.000Z (over 6 years ago)
- Last Synced: 2023-10-18T08:43:57.150Z (about 1 year ago)
- Topics: nextjs, react, react-cosmos, typescript
- Language: JavaScript
- Size: 55.7 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# TypeScript/Next.js/React Cosmos example
This is a simple project forking the [next.js with-typescript](https://github.com/zeit/next.js/tree/canary/examples/with-typescript) example that shows the usage of Next.js with TypeScript and React Cosmos.
## How to use it?
Install it and run:
```bash
npm install
npm run dev
npm run cosmos
# or
yarn
yarn dev
yarn cosmos
```## The idea behind the example
Use the [@zeit/next-typescript](https://github.com/zeit/next-plugins/tree/master/packages/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](https://github.com/zeit/next-plugins/tree/master/packages/next-typescript/#readme).
To get react-cosmos working, we create a webpack config separate from next.js
and point cosmos.config.js to it.