Permalink
Browse files

update require to 2.0.6. Fix build to work with new stuff. better dep…

…endency mappings. separate css optimization.
  • Loading branch information...
1 parent 701eb83 commit c512800382eedba43315320e8702f5ad94500ced @SlexAxton committed Sep 19, 2012
Showing with 1,468 additions and 2,624 deletions.
  1. +8 −1 README.md
  2. +2 −0 build.sh
  3. +13 −2 demo.html
  4. +9 −1 demo/app.build.js
  5. +0 −10 demo/main.js
  6. +228 −175 demo/require.js
  7. 0 demo/template/helpers/all.js
  8. +3 −3 demo/template/helpers/yeller.js
  9. +5 −5 hbs.js
  10. 0 package.json
  11. +1,200 −2,427 r.js
View
@@ -201,7 +201,7 @@ I use them for coding happiness. It shouldn't bother you tooooo much, because it
To run the demo, go into the root directory of this project and run the following command.
-`node r.js -o demo/app.build.js`
+`./build.sh`
This requires that node.js is installed. To see these in your browser, I'd suggest serving them quickly with the python simple server. (Linux/OSX assumed here, but there is a java implementation of the require.js build that should work just as well as the node version. I have not tried it though.)
@@ -210,6 +210,13 @@ cd ~/require-handlebars-plugin
python -m SimpleHTTPServer
```
+You could also use the node 'serve' module.
+
+```sh
+npm install serve -g
+serve .
+```
+
Then visit `http://127.0.0.1:8000/demo.html` for the dev version.
And visit `http://127.0.0.1:8000/demo-build.html` for the production build version.
View
@@ -0,0 +1,2 @@
+node r.js -o demo/app.build.js
+node r.js -o cssIn=demo-build/styles/screen.build.css out=demo-build/styles/screen.build.css
View
@@ -10,15 +10,26 @@
<!-- If you set the require variable to an object, it automatically is the config :D -->
<script>require = {
locale : "en_ca",
+ // default plugin settings, listing here just as a reference
+ hbs : {
+ templateExtension : 'hbs',
+ // if disableI18n is `true` it won't load locales and the i18n helper
+ // won't work as well.
+ disableI18n : false
+ },
// I change the path as to not duplicate the hbs.js and handlebars plugin.
// Normally, just drop it in the same place as require.js and it'll work fine.
// Essentially just ignore this.
paths : {
'hbs' : '../hbs',
- 'Handlebars' : '../Handlebars'
+ 'handlebars' : '../Handlebars',
+ 'underscore' : '../hbs/underscore',
+ 'i18nprecompile' : '../hbs/i18nprecompile',
+ 'json2' : '../hbs/json2'
+
}
};</script>
<!-- use a common require.js and app injection method. -->
<script src="demo/require.js" data-main="demo/main.js"></script>
</body>
-</html>
+</html>
View
@@ -23,7 +23,7 @@
"handlebars" : "../Handlebars",
"underscore" : "../hbs/underscore",
"i18nprecompile" : "../hbs/i18nprecompile",
- "json2" : "../hbs/json2",
+ "json2" : "../hbs/json2"
// if your project is already using underscore.js and you want to keep
// the hbs plugin even after build (excludeHbs:false) you should set the
// "hbs/underscore" path to point to the shared location like
@@ -32,6 +32,14 @@
locale: "en_ca",
+ // default plugin settings, listing here just as a reference
+ hbs : {
+ templateExtension : 'hbs',
+ // if disableI18n is `true` it won't load locales and the i18n helper
+ // won't work as well.
+ disableI18n : false
+ },
+
modules: [
{
name: "main"
View
@@ -1,13 +1,3 @@
-require.config({
- // default plugin settings, listing here just as a reference
- hbs : {
- templateExtension : 'hbs',
- // if disableI18n is `true` it won't load locales and the i18n helper
- // won't work as well.
- disableI18n : false
- }
-});
-
// Require our template with the handlebars plugin
define(['hbs!template/one'], function (tmplOne) {
// Find our container
Oops, something went wrong.

0 comments on commit c512800

Please sign in to comment.