use almond at production; include socketio and dataio clients to the build

This commit is contained in:
oleg 2015-07-28 19:57:02 +03:00
parent 4366105cf8
commit 4d07e3c71e
5 changed files with 15 additions and 11 deletions

View File

@ -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"

View File

@ -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",

View File

@ -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,

View File

@ -1,8 +1,4 @@
require.config({
baseUrl: '/scripts',
paths: {
socketio: '/socket.io/socket.io',
_dataio: '/data.io',
}
baseUrl: '/scripts'
});

View File

@ -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