https://github.com/phphe/rogo
To help build js/ts/vue library with rollup.
https://github.com/phphe/rogo
build-js build-typescript bundle rollup
Last synced: 3 months ago
JSON representation
To help build js/ts/vue library with rollup.
- Host: GitHub
- URL: https://github.com/phphe/rogo
- Owner: phphe
- Created: 2017-04-04T01:40:11.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2023-08-03T06:41:03.000Z (almost 2 years ago)
- Last Synced: 2025-02-15T18:46:24.952Z (4 months ago)
- Topics: build-js, build-typescript, bundle, rollup
- Language: TypeScript
- Homepage:
- Size: 443 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# rogo
To help build js/ts/vue library with rollup.
Add to devDependencies:
```json
"rogo": "^3.0.0"
```Add to package.json (modify it if you don't use default output path):
```json
"main": "dist/index.cjs.js",
"module": "dist/index.esm.js",
```**Check follow for different sources**
## js
Add to dependencies:
```json
"@babel/runtime": "^7.7.7"
```Create `rogo.config.js`
```js
const { getConfig } = require("rogo");const options = {};
module.exports = [
getConfig({ ...options, format: "esm" }),
getConfig({ ...options, format: "cjs" }),
getConfig({ ...options, format: "umd", minify: true, sourcemap: true }),
];
```Run `npx rogo` to build src/index.js to dist folder.
Or add to package.json scripts:
```json
"build-lib": "rogo",
"watch-lib": "rogo -w",
```## ts
Add to dependencies:
```json
"@babel/runtime": "^7.7.7",
"tslib": "^2.3.1"
```Create `rogo.config.ts`
```ts
import { getConfig } from "rogo";const options = {};
export default [
getConfig({ ...options, format: "esm" }),
getConfig({ ...options, format: "cjs" }),
getConfig({ ...options, format: "umd", minify: true, sourcemap: true }),
];
```Run `npx rogo` to build src/index.ts to dist folder.
## vue
There are vue2 and vue3 example in `example` folder. But I recommend you to use vite to bundle vue library.
## rollup
Infact, the `rogo.config.js/ts` export rollup config. So `rollup --config rogo.config.js` also works. You can install other rollup plugins for different tasks. `rogo` contains some helpers, check source code in `packages/core/src/index.ts` for more.