Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/swashcap/demo-rollup-library
A demo library built with rollup.js
https://github.com/swashcap/demo-rollup-library
react rollup typescript
Last synced: 5 days ago
JSON representation
A demo library built with rollup.js
- Host: GitHub
- URL: https://github.com/swashcap/demo-rollup-library
- Owner: swashcap
- License: mit
- Created: 2020-06-03T19:52:16.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-01-06T07:49:43.000Z (almost 2 years ago)
- Last Synced: 2023-04-01T03:28:58.768Z (over 1 year ago)
- Topics: react, rollup, typescript
- Language: TypeScript
- Size: 410 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Demo Rollup Library
_A demo library built with [rollup.js](https://rollupjs.org/guide/en/)_
This demo builds a basic [TypeScript](https://reactjs.org) [React](https://reactjs.org) component library using:
* `@rollup/plugin-node-resolve`: Standard rollup.js plugins for handling module resolution and dependencies
* [`@rollup/plugin-babel`](https://github.com/rollup/plugins/tree/master/packages/babel): Transpile modules with [babel](https://babeljs.io)
* `@babel/preset-typescript`: strip TypeScript types
* `@babel/plugin-transform-runtime`: use `@babel/runtime`
* `external` in `rollup.config.js`: ensures the project's `dependencies` and `peerDependencies` aren't included in the built files## Building
1. Use [nvm](https://github.com/nvm-sh/nvm) to select the correct version of Node.js
```shell
$ cd demo-rollup-library
$ nvm use
# ...
```
2. Install dependencies with [yarn](https://github.com/nvm-sh/nvm):```shell
$ yarn
# ...
```
3. Build:```shell
$ yarn build
# ...
```This produces CommonJS and ES Modules builds:
```shell
$ tree dist
dist
├── cjs
│ └── index.js
└── esm
└── index.js
```