I have struggled a few days to figure this out,, but finally I need your help today.
my repo: https://github.com/seoyoochan/bitsnut-web
what I want to achieve:
- Load and optimize r.js
- Write bower tasks for RequireJS and r.js :
tasks are: minify & uglify & concatenation for RequireJS, and optimise with r.js on production
- How to exclude js script tags in index.html
when using wiredep
tasks and load them through RequireJS loader?
I use Yeoman 'Webapp' generator and generated the scaffold app.
I installed backbone, marionette, text, underscore, and etc via bower install
I modified bower.json
by removing dependencies
and left only "requirejs": "~2.1.16"
on dependencies
. (devDependencies
is empty)
because I use [2][grunt-wiredep]
, everything is automatically loaded bower_components
into index.html
.
I modified .bowerrc
to store dependencies at app/scripts/vendor
.
However, the problem is that I don't know how to successfully load them through ReuqireJS and not to load the vendors as script tags inside index.html
.
I have to write some tasks for RequireJS and r.js, but don't know how to achieve this goal ( I installed grunt-contrib-requirejs
though )
I want to follow the 4th method to make use of r.js
at https://github.com/jrburke/requirejs/wiki/Patterns-for-separating-config-from-the-main-module. but the issue I encountered was that RequireJS's documentation does suggest to not use named module
, but anonymous module
.
I would like to hear various opinions about how I should approach.
I really appreciate your help in advance!