Microbundle: React component library

Created on 14 Dec 2017  路  10Comments  路  Source: developit/microbundle

Does this support creating a react component library and importing a global stylesheet like import tailwindcss/dist/tailwind.min.css?

Most helpful comment

No - CSS should really not be bundled into JS in any case.

All 10 comments

No - CSS should really not be bundled into JS in any case.

That makes sense, I need to reconfigure my lib to not include it in the JS bundle. Thanks again, awesome looking tool by the way. Going to start using it!!

@developit Another quick question regarding this, are we able to import css files into a component? For instance, I have a main.css file i'd like to import and use postcss to extract it to its own file. For instance im using the rollup-postcss-plugin with extract: true to create the css file.

I'd be open to having Microbundle handle that if we can do it in a fairly unopinionated way.

Could we just add the rollup-plugin-postcss plugin and then in the config just do

postcss({
  extract: true
})

this way we can import css files and it will generate the output as a css file

yup, that sounds good. we can probably throw autoprefixer in there too, that's a pretty universal need.

Awesome. I can create a PR for this.

That'd be stellar 馃槉

Submitted PR #30

awesome, merged and we'll release shortly!

Was this page helpful?
0 / 5 - 0 ratings