faulknercs / Knockstrap

Knockout bindings to twitter bootstrap 3
faulknercs.github.io/Knockstrap/
MIT License
142 stars 37 forks source link

Use anonymous module when exporting via AMD #27

Closed yortus closed 9 years ago

yortus commented 9 years ago

Knockstrap currently uses a hardcoded module name when exporting via AMD, which is not recommended practice. I noticed this when trying to use knockstrap, but finding it would only load if served from the root path, because that is the only way the require()'d module ID matches the hardcoded name.

This change only impacts users loading knockstrap via AMD. It does not affect them if they serve knockstrap from the root path (ie at /knockstrap.js), which is the only way it works normally anyway. Anyone else loading knockstrap via AMD on a non-root path would already be using path and map config to work around the problem, so they should also be unaffected. Basically there is little downside to this change.

Here are some further references:

Examples of other knockout plugins (all using anonymous module defines):

faulknercs commented 9 years ago

Thanks for contribution!

yortus commented 9 years ago

Great, thanks! Any idea when your latest changes will make it onto bower?

faulknercs commented 9 years ago

I think, I'll make new release in next two weeks