🚀 Socket Launch Week Day 4:Socket MCP Adds Org Alerts, Threat Feed Review, and Package Inspection.Learn more
Sign In

esbuild-plugin-style-inject

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

esbuild-plugin-style-inject

An esbuild plugin to inject styles (less or css) into the document.

latest
npmnpm
Version
0.0.1
Version published
Maintainers
1
Created
Source

README

npm version install size npm downloads

An esbuild plugin to inject styles (less or css) into the document.

This plugin will bundle the less or css code into the JavaScript code.

# Install less as peer dependency
npm i less

# Install the plugin
npm i esbuild-plugin-style-inject

Usage

const { build } = require('esbuild')
const { styleInjectPlugin } = require('esbuild-plugin-style-inject')

build({
  bundle: true,
  outdir: 'dist',
  entryPoints: ['./src/index.js'],
  plugins: [styleInjectPlugin()]
})

Options

const { build } = require('esbuild')
const { styleInjectPlugin } = require('esbuild-plugin-style-inject')

build({
  bundle: true,
  outdir: 'dist',
  entryPoints: ['./src/index.js'],
  plugins: [
    styleInjectPlugin({
      /**
       * Inject css. Default: `true`.
       */
      css: true,

      /**
       * Inject less. Default: `true`.
       *
       * Note: The less module must be installed.
       */
      less: true
    })
  ]
})

License

MIT

Keywords

esbuild

FAQs

Package last updated on 25 Dec 2023

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