Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

router.init does not work for commonJS #2

Closed
michaelgmcd opened this issue May 12, 2017 · 4 comments
Closed

router.init does not work for commonJS #2

michaelgmcd opened this issue May 12, 2017 · 4 comments

Comments

@michaelgmcd
Copy link
Contributor

michaelgmcd commented May 12, 2017

From Discord:

hey @chenglou#3765, just wanted to let you know that for the webpack "electron-renderer" target (little different than the browser), I had to change the bs-director bindings to point to "director/build/director" instead of director in order to get router.init() to work (per this issue:
flatiron/director#332). Not sure if it's worth adding another external binding like "makeRouterForEnvOtherThanBrowser" (obv. a different name) or if it would be fine to just update the documentation. I copied the bindings over because it's ~4 lines of code, but here's the change:

external makeRouter : Js.t {..} => router =
  "Router" [@@bs.module "director/build/director"] [@@bs.new];

I can file an issue as well.

@alcarvalho
Copy link

alcarvalho commented May 31, 2017

I had to do the same thing with webpack 2.6.1, too. In a regular web application.

@chenglou
Copy link
Contributor

chenglou commented Jun 1, 2017

Done!
Tell me if you want a new release or something.

@chenglou chenglou closed this as completed Jun 1, 2017
@guido4000
Copy link

I ran into the same problem.
@chenglou it might be good to create a new release.

@chenglou
Copy link
Contributor

@guido4000 alright, done! Ping me if there's any problem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants