martonlederer / esbuild-plugin-postcss2

Use postcss with esbuild
MIT License
33 stars 19 forks source link

feat: add writeToFile option #22

Closed gutenye closed 3 years ago

gutenye commented 3 years ago

Usage

esbuild.build({
  plugins: [ 
    postcss({
      writeToFile: false
    })
  ]
}

So that I can use it in this way

import globalCss from './global.css'
import styles, { stylesheet } from './button.module.css'

<>
 <style>{globalCss}</style>
 <button className={styles.button}>Button</button>
 <style>{stylesheet}</style>
</>

Why

  1. Support other platforms other than Web, like UserScript
  2. Try to use the same stylesheet export name from rollup-plugin-postcss