Package Exports
- bocchi
- bocchi/dist/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (bocchi) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
bocchi
A cli build tool for userscript
Install
# npm
npm i bocchi -D
# yarn
yarn add bocchi -D
# pnpm
pnpm i bocchi -DCreate with template
# npm
npm create bocchi-app <name>
# yarn
yarn create bocchi-app <name>
# pnpm
pnpm create bocchi-app <name>Usage
- create
meta.template
// ==UserScript==
// @name
// @namespace #homepage#
// @version #version#
// @description #description#
// @author
// @match https://example.com/*
// @grant none
// @downloadURL
// @updateURL
// ==/UserScript==- write entry
src/index.(j|t)s - add scripts to
package.json
{
"scripts": {
"dev": "bocchi dev",
"build": "bocchi build"
}
}npm run devfor development,npm run buildfor bundle production
Feature
package.jsonsupport rollupglobals
{
"globals": {
"lodash": "window._"
}
}- support
[name].template.html
<!-- file: [name].template.html -->
<template id="tmpId">
<span>1</span>
</template>
<a id="anchorId"></a>// file: index.js
import tmp from './[name].template.html'
console.log(tmp.tmpId) //=> <template id="tmpId">\n <span>1</span>\n</template>
console.log(tmp.anchorId) //=> <a id="anchorId"></a>- auto load
postcss.config.js