diff --git a/bower.json b/bower.json index a4e640d..47779c8 100644 --- a/bower.json +++ b/bower.json @@ -13,7 +13,8 @@ "bootstrap": "3.3.4", "font-awesome": "4.3.0", "react-router": "0.13.3", - "ansi_up": "1.2.1" + "ansi_up": "1.2.1", + "almond": "0.3.1" }, "moduleType": [ "amd" diff --git a/package.json b/package.json index 482599c..1ef0c9a 100644 --- a/package.json +++ b/package.json @@ -11,8 +11,9 @@ "dev": "gulp", "sync": "npm install && npm prune && bower install && bower prune", "buildJs": "r.js -o static/js/requirejs/buid.js", + "buildClean": "rm static/index.html", "buildHtml": "jade views/index.jade --obj '{\"env\": \"production\"}' -o static/", - "build": "npm run buildJs && npm run buildHtml" + "build": "npm run buildJs && npm run buildHtml && git checkout static/scripts/app.js" }, "repository": { "type": "git", diff --git a/static/js/requirejs/buid.js b/static/js/requirejs/buid.js index 1f21f9b..5f83c6a 100644 --- a/static/js/requirejs/buid.js +++ b/static/js/requirejs/buid.js @@ -3,8 +3,11 @@ mainConfigFile: 'development.js', baseUrl: '../', paths: { - socketio: 'empty:', - _dataio: 'empty:' + socketio: ( + '../../node_modules/socket.io/node_modules/' + + 'socket.io-client/socket.io' + ), + _dataio: '../../node_modules/data.io/data.io', }, name: 'app/app', preserveLicenseComments: false, diff --git a/static/js/requirejs/production.js b/static/js/requirejs/production.js index c533b80..c015399 100644 --- a/static/js/requirejs/production.js +++ b/static/js/requirejs/production.js @@ -1,8 +1,4 @@ require.config({ - baseUrl: '/scripts', - paths: { - socketio: '/socket.io/socket.io', - _dataio: '/data.io', - } + baseUrl: '/scripts' }); diff --git a/views/index.jade b/views/index.jade index e19f0b9..84fcf09 100644 --- a/views/index.jade +++ b/views/index.jade @@ -5,8 +5,11 @@ html link(href="/css/index.css", rel="stylesheet", type="text/css") - script - include ../static/js/libs/requirejs/require.js + if env === 'development' + script(type="text/javascript", src="/js/libs/requirejs/require.js") + else + script + include ../static/js/libs/almond/almond.js if env === 'development' script