Skip to content

ar2r13/esbuild-plugin-native-css-module

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

esbuild-plugin-native-css-module

Resolve import ... with { type: css } as instance of CSSStyleSheet in esbuild. If css file linked via <link rel="stylesheet" href="..."> it will be bundled using css loader.

Install

npm i -D esbuild-plugin-native-css-module

Usage

import { build } from 'esbuild'
import nativeCSSModule from 'esbuild-plugin-native-css-module'

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

Example

import style from './style.css' with { type: css }

console.log(style instanceof CSSStyleSheet) // true

About

Resolve import with type css as Constructable Stylesheets

Resources

Stars

Watchers

Forks

Packages

No packages published