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

Unable to bundle modules with defines prefixed with ./ #1190

Closed
rich-nguyen opened this issue Oct 8, 2015 · 3 comments
Closed

Unable to bundle modules with defines prefixed with ./ #1190

rich-nguyen opened this issue Oct 8, 2015 · 3 comments

Comments

@rich-nguyen
Copy link

Hi, I made a repro here to demonstrate the issue.

The bundle command in that test repo fails because there is a './video' define( ) in the UMD module definition code, inside the package used by our app. In requirejs, a required module called ./video still matches the 'video' path in our require config. This is not the case in jspm, which interprets the relative path in the context of the module located in jspm_packages. This looks like well-defined behaviour in system's builder whilst Building the bundle tree, which uses traceModule https://github.com/systemjs/builder/blob/master/lib/trace.js#L26.

This isn't necessarily an issue, more a question for advice. When I encounter a module such as this, is there an elegant way to deal with these kinds of paths? For our jspm packages in github, I will update the path to 'video'. Would be grateful for any info, @guybedford !

@guybedford
Copy link
Member

@rich-nguyen you could try using map configuration to alter this resolution via an override or in the package.json with:

{
  "jspm": {
    "map": {
      "./src/video": "path-to-video"
    }
  }
}

Just let me know if you have any issues with that.

@rich-nguyen
Copy link
Author

I was partway through trying the map configuration, which looked to be working, however it's not supported in curl, so I didn't get to fully test it (the config needs to work for both system and curl, at the moment). So I ended up making sure module names are consistent throughout, which is probably best anyway. Thanks @guybedford

@guybedford
Copy link
Member

Sure, no problem sir!

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