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

Don't define AMD module with a name to make it more portable #62

Closed
arryon opened this issue Feb 2, 2014 · 7 comments
Closed

Don't define AMD module with a name to make it more portable #62

arryon opened this issue Feb 2, 2014 · 7 comments

Comments

@arryon
Copy link

arryon commented Feb 2, 2014

The current AMD module implementation explicitly defines a name for the buzz module, which makes it less portable, see http://requirejs.org/docs/api.html#modulename. If name definition is omitted, this makes the module easier to import into RequireJS.

Can create a pull request if necessary.

stephanebachelier added a commit to stephanebachelier/buzz that referenced this issue Jul 12, 2014
Use an anonymous module to make it more portable see jaysalvat#62
based on https://github.com/umdjs/umd/blob/master/returnExports.js

`define` and `module` being used as a global add consistency by not using `context.define`.
@stephanebachelier
Copy link
Contributor

@arryon I think you can close this issue.

@jaysalvat
Copy link
Owner

Done :)

@norn
Copy link

norn commented Oct 12, 2014

How should I use it with require.js?
I've got "Uncaught ReferenceError: buzz is not defined" error if list buzz as dependency.

@stephanebachelier
Copy link
Contributor

@norn have you configure your path correctly ? Show us some code.

@norn
Copy link

norn commented Oct 13, 2014

@stephanebachelier here it is
var require = {
baseUrl: '/static/js',
shim: {
bustime: {
deps: ['autobahn6.min', 'jquery', 'jquery-ui', {%if us.sound%}'jquery.mb.audio.min', 'buzz', {%endif%}'nbusstops-{{us.city.id}}b']
},
"jquery-ui": {
deps: ['jquery']
}
},
paths: {
'jquery': '//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min',
'jquery-ui':'//ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/jquery-ui.min',
// 'buzz':'//jaysalvat.github.io/buzz/releases/latest/buzz.min',
'bustime': 'bustime-281'
},
deps: ['jquery', 'autobahn6.min', {%if us.sound%}'howler.min', 'jquery.mb.audio.min', 'buzz', {%endif%}'jquery-ui', 'openapi.min', 'nbusstops-{{us.city.id}}b', 'bustime', 'addtohomescreen-ru.min'],
};

@stephanebachelier
Copy link
Contributor

@norn why have you commented the line 'buzz':'//jaysalvat.github.io/buzz/releases/latest/buzz.min'` ?

@norn
Copy link

norn commented Oct 13, 2014

I have tried to use the local one on the server and commented the path. But non of them are worked.

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