Closed iros closed 12 years ago
Hello,
I'm wondering what's wrong with my require js definition (I'm pretty new to require AND miso), Miso
will be undefined
(the setup for jquery is ok)
Any idea?
Regards,
Xavier
require.config({
// base url for vendor libs
// files present : jquery.js, lodash.js, miso.ds.js, moment.js, underscore.deferred.js, underscore.math.js
baseUrl: 'js/lib',
// app components are stored in the js/app folder, so they'll start with 'app/'
paths: {
app: '../app',
},
shim: {
// miso.ds shim, with its dependencies
'miso.ds' : {
deps : ['lodash', 'moment', 'underscore.deferred', 'underscore.math'],
exports: 'Miso'
}
}
});
// start the main app logic.
require(['jquery', 'miso.ds'],
function ($, Miso) {
console.log($);
console.log(Miso);
});
You are correct. I will have a fix shortly and will post it here.
-- Irene
On Mon, Nov 19, 2012 at 3:25 PM, Xavier Seignard notifications@github.comwrote:
Hello, I'm wondering what's wrong with my require js definition (I'm pretty new to require AND miso), Miso will be undefined (the setup for jquery is ok)
Any idea?
Regards,
Xavier
require.config({ // base url for vendor libs // files present : jquery.js, lodash.js, miso.ds.js, moment.js, underscore.deferred.js, underscore.math.js baseUrl: 'js/lib', // app components are stored in the js/app folder, so they'll start with 'app/' paths: { app: '../app', },
shim: { // miso.ds shim, with its dependencies 'miso.ds' : { deps : ['lodash', 'moment', 'underscore.deferred', 'underscore.math'], exports: 'Miso' } }});
// start the main app logic.require(['jquery', 'miso.ds'],function ($, Miso) { console.log($); console.log(Miso);});
— Reply to this email directly or view it on GitHubhttps://github.com/misoproject/dataset/pull/174#issuecomment-10529437.
@xseignard I have updated our builds (note I bumped up the version to 0.4.1.) You can see a sample config.js file here: https://github.com/misoproject/dataset/wiki/How-Do-I...#wiki-requirejs
Miso.Dataset is now also available on JamJS thanks to @tbranyen's amazing help. Thanks.
@iros wow! quick and clean! Thanks! And I really should give a try to jam. Kind regards
You got it @xseignard =)
Fixes #166 Added require support. Note this is only in the non dependency builds. This is because the whole point is for require.js to manage dependencies. You must include moment.js and lodash/underscore yourself as dependencies.