library bundle

This commit is contained in:
Jörn-Michael Miehe 2018-09-30 22:50:48 +02:00
parent 165a29ec1a
commit 0bb91a1403
4 changed files with 14 additions and 6 deletions

View file

@ -6,12 +6,13 @@ var uglify = require('gulp-uglify-es').default;
var concat = require('gulp-concat'); var concat = require('gulp-concat');
var paths = { var paths = {
scripts: 'client/scripts/**/*.coffee', coffee: 'client/scripts/**/*.coffee',
lib: 'client/lib/**/*.js',
images: 'client/img/**/*' images: 'client/img/**/*'
}; };
gulp.task('js', function(){ gulp.task('coffee', function(){
return gulp.src(paths.scripts) return gulp.src(paths.coffee)
.pipe(sourcemaps.init()) .pipe(sourcemaps.init())
.pipe(concat('app.min.js')) .pipe(concat('app.min.js'))
.pipe(coffee({bare: true})) .pipe(coffee({bare: true}))
@ -23,4 +24,12 @@ gulp.task('js', function(){
.pipe(gulp.dest('static')) .pipe(gulp.dest('static'))
}); });
gulp.task('default', [ 'js' ]); gulp.task('lib', function(){
return gulp.src(paths.lib)
.pipe(sourcemaps.init())
.pipe(concat('lib.min.js'))
.pipe(sourcemaps.write())
.pipe(gulp.dest('static'))
});
gulp.task('default', [ 'coffee', 'lib' ]);

View file

@ -5,8 +5,7 @@
<link rel="stylesheet" href="style.css" /> <link rel="stylesheet" href="style.css" />
<script src="/socket.io/socket.io.js"></script> <script src="/socket.io/socket.io.js"></script>
<script src="/lib/jquery-3.3.1.min.js"></script> <script src="lib.min.js"></script>
<script src="/lib/crafty-min.js"></script>
<script src="app.min.js"></script> <script src="app.min.js"></script>
</head> </head>
<body /> <body />