scrapbox-bundle-all
/icons/hr.icon
1. 以下をterminalから実行
code:sh
code:build.ts
import {run} from '../UserScriptをbundleするDeno_script/script.ts';
const fileNames = [
'AGI',
'private',
'yosider',
'programming-notes',
'villagepump',
'symbolic-computation',
'kyopro-notes',
'minecraft-notes',
'english-notes',
'Unity-memo',
'yosider-scripts',
'project01',
'project13',
'project41',
'project98',
'clusterwiki',
'projectEC',
];
bundleする
code:build.ts
for (const fileName of fileNames) {
const {outputFiles} = await run(
https://scrapbox.io/api/code/yosider-scripts/for-${fileName}/script.js,
{},
{
external: [
],
charset: 'utf8',
bundle: true,
minify: true,
write: false, // 標準出力やfileにbundleしたコードを出力しない
}
);
}
code:build.ts
let json: {pages: {title: string; lines: string[];}[];} = {pages: []};
for (const key in codes) {
const page = {
title: for-${key}-min,
lines: [
for-${key}-min,
[/${key}]で使うUserScript,
[for-${key}]を[UserScriptをbundleするDeno script]でbundleしたもの,
via [scrapbox-bundle-all],
'',
'code:script.js',
...codeskey.split('\n').map(line => ${line}), ],
};
json.pages.push(page);
}
await Deno.writeTextFile('import.json', JSON.stringify(json));
https://gyazo.com/e2c1732c6142d1b639c642cba413c28b