Socket
Book a DemoInstallSign in
Socket

esbuild-plugin-brotli

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

esbuild-plugin-brotli

esbuild plugin brotli compress

latest
Source
npmnpm
Version
0.2.0
Version published
Weekly downloads
5
-28.57%
Maintainers
1
Weekly downloads
 
Created
Source

esbuild-brotli-plugin for Node.js

npm version

An esbuild plugin to compress asset files with brotli.

How to use?

import tailwindCss from "./tailwind.css?br"

router.get('/assets/tailwind.css', () => {
    return new Response(tailwindCss, {
        headers: {
            "Content-Type": "text/css",
            "content-encoding": "br"
        }
    })
});

esbuild example

const esbuild = require('esbuild');
const brotliPlugin = require('esbuild-plugin-brotli');

esbuild.build({
    bundle: true,
    entryPoints: ['hello.js'],
    plugins: [brotliPlugin],
    write: false
}).then(result => {
    console.log(result.outputFiles[0].text);
}).catch(() => process.exit(1));

Keywords

esbuild

FAQs

Package last updated on 30 Sep 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts