esbuild-plugin-cache
PR出したい

なんてPR書けばいいのかな?
enable the \
extenal\ option
でいいかな?
一旦Issue書いて、それを参照する形でPRだすのがよさそう
タイトルは Throw Error when \
external\ is set
2021-05-25 17:22:40 できた
Denoから使うのが簡単
shgit clone https://github.com/rhysd/react-vim-wasm
cd react-vim-wasm
deno run --prompt --allow-net=raw.githubusercontent.com,esm.sh,cdn.esm.sh --allow-read=./,~/.cache/esbuild --allow-write=./ --unstable -r=https://scrapbox.io/api/code/takker/esbuild-plugin-cache/sample.js https://scrapbox.io/api/code/takker/esbuild-plugin-cache/sample.js
sample.jsimport * as esbuild from 'https://deno.land/x/esbuild/mod.js';
import { cache } from 'https://raw.githubusercontent.com/takker99/esbuild-plugin-cache/master/deno/mod.ts';
const importmap = {
imports: {
'vim-wasm': 'https://esm.sh/vim-wasm/vimwasm.js',
},
};
const {code} = await esbuild.build({
entryPoints: ['index.ts'],
outfile: 'index.min.js',
bundle: true,
minify: true,
platform: 'neutral',
jsxFactory: 'h',
jsxFragment: 'Fragment',
external: ['react'],
plugins: [cache({ importmap, directory: './cache' })],
});
esbuild.stop();