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

import urijs into es6 project #288

Closed
helt opened this issue Mar 25, 2016 · 3 comments
Closed

import urijs into es6 project #288

helt opened this issue Mar 25, 2016 · 3 comments

Comments

@helt
Copy link

helt commented Mar 25, 2016

I have to work with a ES6 project, and sought to use urijs for url manipulation. However, i do not seem to get urijs to be accepted in my source.

Neither import URI from "urijs"; nor import * as URI from "urijs"; nor plain var URI = require("urijs");
will work out as imagined...

Maybe urijs is not compatible with es6 / babel or am i missing something obvious?

@helt
Copy link
Author

helt commented Mar 25, 2016

Okay. I got it.

import * as URI from 'urijs';

does work, but for some reason i am only able to access the static methods. The URI() object is not available, and therefore none of the really neat functions that are attached to it and its parts. :(

Any ideas how to fix that?

@rodneyrehm
Copy link
Member

I don't know what system you're using to import modules import URI from 'urijs'; should work. That module has only one export and that should be considered the default export.

@helt
Copy link
Author

helt commented Mar 26, 2016

argh. Invalidating intellij cache and restarting did the trick... nonetheless, good to know that it should work :) however, its strange that webpack did not bundle it correctly...

so... i guess the issue is not reproducible...

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

2 participants