diff --git a/fake-app.json b/fake-app.json index 631a470..5bbacce 100644 --- a/fake-app.json +++ b/fake-app.json @@ -1,13 +1,14 @@ { - "port": 80, - "app": "dist/app.min.html", + "port": 8080, + "host": "127.0.0.1", + "app": "dist/app.html", "scripts": null, "styles": null, "static": { "url": "/dist", "dir": "dist", "options": { - "maxAge": "24h" + "maxAge": "0" } } } diff --git a/gulpfile.js b/gulpfile.js index 1577d8e..b67802c 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -53,21 +53,18 @@ gulp.task('build:swig', () => // Minification gulp.task('minify:javascript', [ 'build:javascript' ], () => gulp.src('dist/app.js') - .pipe(rename('app.min.js')) .pipe(uglify()) .pipe(gulp.dest('dist')) ); gulp.task('minify:css', [ 'build:stylus' ], () => gulp.src('dist/app.css') - .pipe(rename('app.min.css')) .pipe(minCSS()) .pipe(gulp.dest('dist')) ); gulp.task('minify:html', [ 'build:swig' ], () => gulp.src('dist/app.html') - .pipe(rename('app.min.html')) .pipe(minHTML()) .pipe(gulp.dest('dist')) ); @@ -88,15 +85,15 @@ gulp.task('minify', [ ]); // Alias for build & minify -gulp.task('default', [ 'minify' ]); +gulp.task('default', [ 'build' ]); // Watch -gulp.task('watch', [ 'minify' ], function(){ - gulp.watch('views/**', [ 'build:swig', 'minify:html' ]); - gulp.watch('styles/**', [ 'build:stylus', 'minify:css' ]); - gulp.watch('scripts/**', [ 'build:javascript', 'minify:javascript' ]); +gulp.task('watch', [ 'build' ], function(){ + gulp.watch('views/**', [ 'build:swig' ]); + gulp.watch('styles/**', [ 'build:stylus' ]); + gulp.watch('scripts/**', [ 'build:javascript' ]); // Create fake app-server: - fake([ '-c', 'app.json', '--port=8080', '--static.maxAge="0"' ]); + fake([ '-c', 'fake-app.json' ]); require('app-server'); }); diff --git a/scripts/app.js b/scripts/app.js index b3e6b05..5a5fad7 100644 --- a/scripts/app.js +++ b/scripts/app.js @@ -1,5 +1,5 @@ import app from './test'; -import 'jquery'; +import $ from 'jquery'; $(function(){ console.log(app); diff --git a/views/index.html b/views/index.html index 038774e..9632022 100644 --- a/views/index.html +++ b/views/index.html @@ -3,8 +3,8 @@