Skip to content
This repository has been archived by the owner on Jul 12, 2020. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
…amentals into gh-pages

* 'gh-pages' of http://github.com/addyosmani/backbone-fundamentals:
  Add note about js extensions in R.js build config
  • Loading branch information
addyosmani committed Mar 31, 2013
2 parents 8a25fdd + 2c0ff2a commit be68f22
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions chapters/08-modular-development.md
Expand Up @@ -479,7 +479,7 @@ define(['jquery', 'backbone', 'underscore'].concat(models),
will be ignored. This is by design as it ensures that dynamic dependency/module loading can still take place even after optimization.
Although the RequireJS optimizer works fine in both Node and Java environments, it's strongly recommended to run it under Node as it executes significantly faster there.
Although the RequireJS optimizer works fine in both Node and Java environments, it's strongly recommended to run it under Node as it executes significantly faster there.
To get started with r.js, grab it from the [RequireJS download page](http://requirejs.org/docs/download.html#rjs) or [through NPM](http://requirejs.org/docs/optimization.html#download). To begin getting our project to build with r.js, we will need to create a new build profile.
Expand All @@ -491,7 +491,7 @@ Assuming the code for our application and external dependencies are in `app/libs
out: 'dist/main.js',
```
The paths above are relative to the `baseUrl` for our project and in our case it would make sense to make this the `app` folder. The `out` parameter informs r.js that we want to concatenate everything into a single file.
The paths above are relative to the `baseUrl` for our project and in our case it would make sense to make this the `app` folder. The `out` parameter informs r.js that we want to concatenate everything into a single file, that should be called `main.js` and be created within the `dist/` directory. Note that here, we do need to add the `.js` extension to the filename. Earlier we saw that when referencing modules by filenames, you don't need to use the `.js` extension, however this is one case in which you do.
Alternatively, we can specify `dir`, which will ensure the contents of our `app` directory are copied into this directory. e.g:
Expand Down Expand Up @@ -1440,4 +1440,4 @@ Paginator.clientPager = Backbone.Collection.extend({
[4]: http://addyosmani.github.com/backbone.paginator/examples/netflix-client-paging/index.html
[5]: http://addyosmani.github.com/backbone.paginator/examples/netflix-infinite-paging/index.html
[6]: http://github.com/addyosmani/backbone.paginator/issues
[7]: https://github.com/cowboy/grunt
[7]: https://github.com/cowboy/grunt

0 comments on commit be68f22

Please sign in to comment.