cognitom / riot-bootstrap

Bootstrap-like Components for Riot.js
http://cognitom.github.io/riot-bootstrap/
136 stars 11 forks source link

Selective Imports #12

Open cuu508 opened 8 years ago

cuu508 commented 8 years ago

I installed riot-bootstrap with npm. I'm bundling my app with webpack. In my index.js file I import riot-bootstrap like so:

import 'riot-bootstrap'

This pulls all riot-bootstrap tags in the generated bundle, even if I only actually use, say <btn>. Is there a way to import only the tags I'll actually be using? Or maybe exclude some tags I won't need?

cognitom commented 8 years ago

@cuu508 I'm not sure about webpack, but it could be done like this:

import `riot-bootstrap/src/btn.tag`

And I have a plan to break riot-bootstrap into some repos, but not yet.

cuu508 commented 8 years ago

If I install riot-bootstrap with npm, I get an all-or-nothing node_modules/riot-bootstrap/dist/riot-bootstrap.js file.

For time being, I just copied the needed tag files into my project and that works.