Closed parkm closed 10 years ago
It should go in /src. You can actually define file locations in whatever RequireJS's project file is, so we can have the best of both worlds.
require(['bpm', 'lib/thing']);
On Wed, Apr 30, 2014 at 11:30 PM, Parker Miller notifications@github.comwrote:
Where should main.js go? src or root?
The reason I ask is because on RequireJS. If it were in root we'd use require like:
require(['src/bpm', 'lib/thatthing']);
but if we were to put it in src we'd use it like:
require(['bpm', '../lib/thatthing']);
I don't like using '..' especially if we are to have any nested files. But for this project that probably won't happen so what do you think?
— Reply to this email directly or view it on GitHubhttps://github.com/despondentdonkey/bpm/issues/12 .
Oh yeah so it's always based of data-main right? So I did:
require.config({
paths: {
lib: '../lib/'
}
});
so if I have root/src/adir/bdir/bob.js
and in it I go:
define(['lib/greg'], function(){});
it will load
root/lib/greg.js
not
root/src/adir/lib/greg.js
since it's based on data-main which is root/src/main.js
Yup, I'm fairly sure it works like that.
On Thu, May 1, 2014 at 12:05 PM, Parker Miller notifications@github.comwrote:
Closed #12 https://github.com/despondentdonkey/bpm/issues/12.
— Reply to this email directly or view it on GitHubhttps://github.com/despondentdonkey/bpm/issues/12 .
Where should main.js go? src or root?
The reason I ask is because on RequireJS. If it were in root we'd use require like:
require(['src/bpm', 'lib/thatthing']);
but if we were to put it in src we'd use it like:
require(['bpm', '../lib/thatthing']);
I don't like using '..' especially if we are to have any nested files. But for this project that probably won't happen so what do you think?