Permalink
Browse files

produce optimized rjs blob

  • Loading branch information...
1 parent 84a03da commit b45f9847b3df85379b421d66ff9cd79065a1932d @purge purge committed Oct 2, 2013
Showing with 16 additions and 13 deletions.
  1. +1 −0 .gitignore
  2. +1 −0 .npmignore
  3. +12 −1 Gruntfile.coffee
  4. +0 −11 config-sample.js
  5. +1 −1 package.json
  6. +1 −0 src/sqwidget.coffee
View
@@ -3,3 +3,4 @@ node_modules/
config.js
compiled/**/*.*
lib/
+dist/
View
@@ -2,3 +2,4 @@ npm-debug.log
node_modules
src
test
+compiled
View
@@ -5,14 +5,15 @@ module.exports = (grunt) ->
grunt.loadNpmTasks 'grunt-contrib-watch'
grunt.loadNpmTasks('grunt-contrib-connect')
grunt.loadNpmTasks('grunt-contrib-copy')
+ grunt.loadNpmTasks('grunt-contrib-requirejs')
grunt.loadNpmTasks('grunt-karma')
grunt.initConfig
clean:
all:
- src: [ "compiled/js", "compiled/tests" ]
+ src: [ "compiled", "dist" ]
connect:
publisher:
@@ -61,7 +62,17 @@ module.exports = (grunt) ->
files: ["src/**/*.coffee", "tests/**/*.coffee"]
tasks: ["build", "karma"]
+ requirejs:
+ compile:
+ options:
+ name: "sqwidget"
+ optimize: 'none'
+ baseUrl: "compiled/js",
+ mainConfigFile: "compiled/js/sqwidget.js",
+ out: "dist/sqwidget.js"
+
grunt.registerTask "build", [ "coffee" ]
+ grunt.registerTask "dist", [ "coffee", "requirejs" ]
grunt.registerTask "test", [ "clean", "build", "karma" ]
grunt.registerTask "default", [ "clean", "build", "connect", "watch" ]
View
@@ -1,11 +0,0 @@
-/*
- * All the config options etc.
- */
-define([], function() {
- return {
- "api_key": "API_KEY_HERE",
- "api_root": "URL_ROOT_HERE",
- "games_id": "current-games-id-here",
- "refresh_interval": 60000
- }
-});
View
@@ -6,7 +6,7 @@
"Adhip Gupta <me@adhipg.in>",
"Simon Elliott <simon@papercreatures.com>"
],
- "main": "compiled/js/sqwidget.js",
+ "main": "dist/sqwidget.js",
"engines": {
"node": ">= 0.8.0"
},
View
@@ -2,6 +2,7 @@ requirejs.config
paths:
jquery: '../../lib/jquery/jquery'
underscore: '../../lib/underscore-amd/underscore'
+ backbone: '../../lib/backbone-amd/backbone'
# The module that is loaded first
requirejs [

0 comments on commit b45f984

Please sign in to comment.