diff --git a/Dockerfile b/Dockerfile index bd1a834..ff446e6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,8 +1,5 @@ FROM node:latest -# global deps -RUN npm install gulp-cli -g - # Create app directory WORKDIR /usr/src/app @@ -17,7 +14,6 @@ RUN npm install # Bundle app source COPY . . -RUN gulp EXPOSE 8080 diff --git a/client/lib/jquery-3.3.1.min.js b/client/lib/10-jquery-3.3.1.min.js similarity index 100% rename from client/lib/jquery-3.3.1.min.js rename to client/lib/10-jquery-3.3.1.min.js diff --git a/client/lib/crafty-min.js b/client/lib/20-crafty-min.js similarity index 100% rename from client/lib/crafty-min.js rename to client/lib/20-crafty-min.js diff --git a/gulpfile.js b/gulpfile.js index 65c75a4..fc9ac5a 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -8,7 +8,9 @@ var concat = require('gulp-concat'); var paths = { coffee: 'client/scripts/**/*.coffee', lib: 'client/lib/**/*.js', - images: 'client/img/**/*' + images: 'client/img/**/*', + dest: 'static', + maps: 'maps' }; gulp.task('coffee', function(){ @@ -20,16 +22,16 @@ gulp.task('coffee', function(){ return '$(function () {' + contents + '});'; })) .pipe(uglify()) - .pipe(sourcemaps.write()) - .pipe(gulp.dest('static')) + .pipe(sourcemaps.write(paths.maps)) + .pipe(gulp.dest(paths.dest)) }); gulp.task('lib', function(){ return gulp.src(paths.lib) .pipe(sourcemaps.init()) .pipe(concat('lib.min.js')) - .pipe(sourcemaps.write()) - .pipe(gulp.dest('static')) + .pipe(sourcemaps.write(paths.maps)) + .pipe(gulp.dest(paths.dest)) }); gulp.task('default', [ 'coffee', 'lib' ]); diff --git a/server.js b/server.js index 6fa9bd2..fc24e38 100644 --- a/server.js +++ b/server.js @@ -2,7 +2,12 @@ var http = require('http'), socketio = require('socket.io'), - express = require('express'); + express = require('express'), + gulp = global.gulp = require('gulp'); + +// gulp the sources +require('./gulpfile'); +gulp.start('default'); // socket.io framework let app = express();