meteor-bower icon indicating copy to clipboard operation
meteor-bower copied to clipboard

Bower package loads in lib/main.jsx but not in lib/transit.jsx

Open ndarilek opened this issue 8 years ago • 0 comments

Loading react-bootstrap like so:

  "overrides": {
    "react-bootstrap": {
      "arch": [
        "client",
        "server"
      ]

In lib/main.jsx I can do:

const {Col, Grid, Nav, Navbar, NavItem, Row} = ReactBootstrap

And I can render react-bootstrap components client and server-side. Neat.

The problem arises when I try:

const {Pager, PageItem} = ReactBootstrap

in lib/transit.jsx. I'm told that ReactBootstrap is undefined.

I've had to result to this:

Meteor.startup(function() {
  Pager = ReactBootstrap.Pager
  PageItem = ReactBootstrap.PageItem
})

But, naturally, that's a bit ugly and I'd rather not. :)

I'm trying to use main.* to define fairly generic code that I can carry between apps mostly or highly unchanged. Is it at all possible to get access to ReactBootstrap and other server-side Bower libraries from other files loaded earlier?

Thanks.

ndarilek avatar Aug 21 '15 15:08 ndarilek