mirror of
https://github.com/logsol/chuck.js.git
synced 2026-05-11 10:37:34 +00:00
restructured scripts for building and some improvements
This commit is contained in:
parent
c33e9f62b9
commit
005913dae9
8 changed files with 231 additions and 15 deletions
|
|
@ -2,10 +2,10 @@ define([
|
|||
'http',
|
||||
'node-static',
|
||||
'Server/Api',
|
||||
'zlib'
|
||||
'fs'
|
||||
],
|
||||
|
||||
function (http, nodeStatic, Api, zlib) {
|
||||
function (http, nodeStatic, Api, fs) {
|
||||
|
||||
function HttpServer (options, coordinator) {
|
||||
options.port = options.port || 1234;
|
||||
|
|
@ -46,7 +46,13 @@ function (http, nodeStatic, Api, zlib) {
|
|||
break;
|
||||
|
||||
case req.url == '/client.js':
|
||||
fileServer.serveFile('./client.js', 200, {}, req, res);
|
||||
fs.exists('./build/client.min.js', function (exists) {
|
||||
if (process.env.NODE_ENV && process.env.NODE_ENV == 'production' && exists) {
|
||||
fileServer.serveFile('./build/client.min.js', 200, {}, req, res);
|
||||
} else {
|
||||
fileServer.serveFile('./client.js', 200, {}, req, res);
|
||||
}
|
||||
});
|
||||
break;
|
||||
|
||||
case req.url == '/client.min.js':
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue