Skip to content

esmfile/esbuild-plugin-esmcss

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

48 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

esbuild-plugin-esmcss

Build .css.ts/.css.js modules as css assets.

install

npm i -D esbuild-plugin-esmcss

usage

Build file

import { build } from 'esbuild'
import esmcss from 'esbuild-plugin-esmcss'
await build({
  entryPoints: [/* source code entry point */],
  plugins: [esmcss()]
})

Component file

import './component.css.js'
export function html_() {
  return `
<!DOCTYPE html>
<html>
  <head>
  link_({ rel: 'stylesheet', type: 'text/css', href })
    <link rel="stylesheet" type="text/css" href="/path/to/cssBundle.css">
  </head>
  <body>
    <div class="my_component">Hello!</div>
  </body>
</html>
  `.trim()
}

component.css.ts

export default ()=>`
.my_component {
  color: green;
}
`

About

Build *.css.ts/*.css.js modules as css assets.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published