1
0
mirror of https://github.com/chinchang/web-maker.git synced 2025-07-07 23:22:43 +02:00

change build dir to app/

This commit is contained in:
Kushagra Gour
2017-11-19 23:47:02 +05:30
parent 2482435088
commit 90727ebd16
2 changed files with 30 additions and 26 deletions

View File

@ -1,37 +1,41 @@
var gulp = require('gulp'); var gulp = require('gulp');
// var uglify = require('gulp-uglify'); // var uglify = require('gulp-uglify');
// var minifyCSS = require('gulp-csso'); // var minifyCSS = require('gulp-csso');
var useref = require('gulp-useref'); var useref = require('gulp-useref');
gulp.task('css', function(){ gulp.task('css', function() {
return gulp.src([ return gulp
'src/lib/codemirror/lib/codemirror.css', .src([
'src/lib/codemirror/addon/hint/show-hint.css', 'src/lib/codemirror/lib/codemirror.css',
'src/lib/codemirror/addon/fold/foldgutter.css', 'src/lib/codemirror/addon/hint/show-hint.css',
'src/lib/hint.min.css', 'src/lib/codemirror/addon/fold/foldgutter.css',
'src/lib/inlet.css', 'src/lib/hint.min.css',
'src/style.css', 'src/lib/inlet.css',
]) 'src/style.css'
.pipe(concat('build.css')) ])
.pipe(minifyCSS()) .pipe(concat('build.css'))
.pipe(gulp.dest('src')) .pipe(minifyCSS())
.pipe(gulp.dest('src'));
}); });
gulp.task('useRef', [],function() { gulp.task('useRef', [], function() {
return gulp.src('src/index.html') return gulp.src('src/index.html').pipe(useref()).pipe(gulp.dest('app'));
.pipe(useref())
.pipe(gulp.dest('dist'));
}); });
gulp.task('generate-service-worker', [ 'useRef' ], function(callback) { gulp.task('generate-service-worker', ['useRef'], function(callback) {
var swPrecache = require('sw-precache'); var swPrecache = require('sw-precache');
var rootDir = 'dist'; var rootDir = 'app';
swPrecache.write(`${rootDir}/service-worker.js`, { swPrecache.write(
staticFileGlobs: [rootDir + '/**/*.{js,html,css,png,jpg,gif,svg,eot,ttf,woff}'], `${rootDir}/service-worker.js`,
stripPrefix: rootDir {
}, callback); staticFileGlobs: [
rootDir + '/**/*.{js,html,css,png,jpg,gif,svg,eot,ttf,woff}'
],
stripPrefix: rootDir
},
callback
);
}); });
gulp.task('default', [ 'generate-service-worker' ]); gulp.task('default', ['generate-service-worker']);

View File

@ -101,7 +101,7 @@ globalConsoleContainerEl, externalLibrarySearchInput, keyboardShortcutsModal
}; };
const AUTO_SAVE_INTERVAL = 15000; // 15 seconds const AUTO_SAVE_INTERVAL = 15000; // 15 seconds
const BASE_PATH = chrome.extension ? '/' : '/dist/'; const BASE_PATH = chrome.extension ? '/' : '/app/';
var updateTimer, var updateTimer,
updateDelay = 500, updateDelay = 500,