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

AMD export is now a named module in v1.6.21 #274

Closed
glenpike opened this issue Jan 29, 2016 · 4 comments
Closed

AMD export is now a named module in v1.6.21 #274

glenpike opened this issue Jan 29, 2016 · 4 comments

Comments

@glenpike
Copy link

This is related to #269 and #267 from what I can see, but I will post here as a note that might help other people.

The new export mechanism generated by Rollup JS seems to have exported topojson as a named module. This means you can no longer load the module via it's file path when you use it in AMD / RequireJS you have to create an alias, e.g.

v1.6.20

//This worked okay
define(['bower_components/topojson/topjson'], function(topojson) {
  console.log(topojson.feature);
})

v1.6.21

require.config({
  paths: {
    topojson: 'bower_components/topojson/topjson'
  }
});
define(['topojson'], function(topojson) {
  console.log(topojson.feature);
})

http://requirejs.org/docs/api.html#modulename
http://stackoverflow.com/questions/19720646/named-module-vs-unnamed-module-in-requirejs

@glenpike
Copy link
Author

It might be possible to change the rollup command to export an anonymous module by not specifying the "-u" parameter - https://github.com/rollup/rollup/wiki/Command%20Line%20Interface

@mbostock
Copy link
Member

This is a bug; I’ll remove the name.

@mbostock
Copy link
Member

Fixed in 1.6.22.

@glenpike
Copy link
Author

Nice, thanks, I'll give that a try next week 👍

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