Instead of --require prime ./node_modules/prime/index.js, you can simply do
--require prime prime.
Also if the file you're writing your JS in requires prime, the only thing
you have to require with wrapup is your main file.
main.js:
var prime = require('prime');
// do something with prime
So for the browser
cli:
wrup --require ./main.js --output wrupped.js
html:
<script src="wrupped.js"></script>
And in node:
node main.js
An Options thing can be found in prime-util:
https://github.com/arian/prime-util#primeoptions
On Wed, Dec 4, 2013 at 1:45 PM, Dimitar Christoff <[email protected]>wrote:
> if you use UMD wraps, your code will run in the browser and in node
> without any changes or build steps.
>
>
> https://github.com/DimitarChristoff/primish/blob/master/emitter.js#L106-L114-
> especially if you don’t care about AMD or exports to global, it’s easy to
> pass deps - even more complicated ones.
>
> if you care about all three and have a more complex dependency tree, you
> can still resolve them.
>
> https://github.com/epitome-mvc/Epitome/blob/master/src/epitome-model.js#L175-L185
>
> bottom line: any of these files will work under node or the browser
> without any modification.
>
> --
> Dimitar Christoff
>
> "JavaScript is to JAVA what hamster is to ham"
> @D_mitar - https://github.com/DimitarChristoff
>
> On 4 Dec 2013, at 11:46, santos <[email protected]> wrote:
>
> > Thank you very much,
> >
> > I finally managed to make prime work for my classes in the browser.
> >
> > For now i'm wrapiing up the prime and emitter module using the console
> like that
> >
> > $ wrup -r prime ./node_modules/prime/prime.js -o ./public/js/prime.js
> > $ wrup -r emitter ./node_modules/prime/emitter.js -o
> ./public/js/emitter.js
> >
> > Now, I'm not sure how to do that in my node application, I will try it.
> >
> > In primish we had "options", where can i find it in prime?
> >
> > regards
> >
> >
> >
> > --
> >
> > ---
> > You received this message because you are subscribed to the Google
> Groups "MooTools Users" group.
> > To unsubscribe from this group and stop receiving emails from it, send
> an email to [email protected].
> > For more options, visit https://groups.google.com/groups/opt_out.
>
> --
>
> ---
> You received this message because you are subscribed to the Google Groups
> "MooTools Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/groups/opt_out.
>
--
---
You received this message because you are subscribed to the Google Groups
"MooTools Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.