v0.3.1
esbuild plugin for Deno that resolves HTTP/HTTPS and npm imports using its cache system
Attributes
Includes Deno configuration
Repository
Current version released
2 years ago
esbuild-cache-plugin for Deno
An esbuild plugin to cache HTTP/HTTPS imports for Deno.
Example
import esbuild from 'esbuild';
import esbuildCachePlugin from 'esbuild-cache-plugin';
await esbuild.build([
entryPoints: ['app.js'],
bundle: true,
outfile: 'out.js',
plugins: [
esbuildCachePlugin({
directory: cachePath,
importmap: {
imports: {
"preact": "https://esm.sh/preact@10.13.2"
}
},
rules: [
{
test: /\.css$/,
loader: 'css'
}
],
}),
],
]);
Options
interface Options {
directory?: string;
importmap: Importmap;
rules?: [{
test: RegExp;
loader: Loader | string;
}];
}
directory
: location where cache files are createdimportmap
: importmap for resolve importrules
: Rules for loader selection based on file nametest
:RegExp
object to test file nameloader
a loader used to load file (default: esbuild default)