Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/ironkinoko/bocchi

A cli build tool for userscript
https://github.com/ironkinoko/bocchi

cli greasemonkey tampermonkey userscript violentmonkey

Last synced: 12 days ago
JSON representation

A cli build tool for userscript

Awesome Lists containing this project

README

        

# bocchi

A cli build tool for userscript

## Install

```shell
# npm
npm i bocchi -D

# yarn
yarn add bocchi -D

# pnpm
pnpm i bocchi -D
```

### Create with template

```shell
# npm
npm create bocchi-app

# yarn
yarn create bocchi-app

# pnpm
pnpm create bocchi-app
```

## Usage

1. create `meta.template`

```
// ==UserScript==
// @name
// @namespace #homepage#
// @version #version#
// @description #description#
// @author
// @match https://example.com/*
// @grant none
// @downloadURL
// @updateURL
// ==/UserScript==
```

2. write entry `src/index.(j|t)s`
3. add scripts to `package.json`

```json
{
"scripts": {
"dev": "bocchi dev",
"build": "bocchi build"
}
}
```

4. `npm run dev` for development, `npm run build` for bundle production

## Feature

1. `package.json` support rollup `globals`

```json
{
"globals": {
"lodash": "window._"
}
}
```

2. support `[name].template.html`

```html

1


```

```js
// file: index.js
import tmp from './[name].template.html'

console.log(tmp.tmpId) //=> \n 1\n
console.log(tmp.anchorId) //=>
```

3. auto load `postcss.config.js`