Skip to content
This repository has been archived by the owner on Nov 4, 2019. It is now read-only.

Commit

Permalink
using deployment vuejs when query '?debug=true'
Browse files Browse the repository at this point in the history
update sw precache version,
  • Loading branch information
eynol committed Mar 13, 2017
1 parent 764d5af commit 0c58ba8
Show file tree
Hide file tree
Showing 10 changed files with 85 additions and 745 deletions.
79 changes: 51 additions & 28 deletions gulpfile.js
Original file line number Diff line number Diff line change
@@ -1,45 +1,68 @@
var gulp =require('gulp');
var gulp = require('gulp');
var stylus = require('gulp-stylus');
var plumber = require('gulp-plumber');
var strip = require('gulp-strip-debug');
var rename = require('gulp-rename');
var uglify = require('gulp-uglify');
var sourcemaps = require('gulp-sourcemaps');

gulp.task('default',function(){
gulp.task('default', function () {
console.log('default task');

});


gulp.task('watch',function(){

gulp.watch('./stylus/**/*',['stylus']);

gulp.task('watch', function () {
gulp.watch('./stylus/**/*', ['stylus']);
gulp.watch('./public/js/index.js',['js:index'])
})
gulp.task('stylus',function(){
return gulp.src('./stylus/**/*')
.pipe(plumber())
.pipe(stylus())
.pipe(gulp.dest('./public/css'))
gulp.task('stylus', function () {
return gulp
.src('./stylus/**/*')
.pipe(plumber())
.pipe(sourcemaps.init())
.pipe(stylus({
compress:true,
}))
.pipe(sourcemaps.write('.'))
.pipe(gulp.dest('./public/css'))

})

gulp.task('dep',['dep:vue','dep:semantic','dep:zepto']);
gulp.task('js:index', function () {
return gulp
.src('./public/js/index.js')
.pipe(strip())
.pipe(rename("index.min.js"))
.pipe(uglify())
.pipe(gulp.dest('./public/js'))
});


gulp.task('dep', ['dep:vue', 'dep:semantic', 'dep:zepto']);

gulp.task('dep:vue',function(){
return gulp.src('node_modules/vue/dist/**/*')
.pipe(gulp.dest('public/lib/vue')).on('error',function(e){
console.log(e);
});
gulp.task('dep:vue', function () {
return gulp
.src('node_modules/vue/dist/**/*')
.pipe(gulp.dest('public/lib/vue'))
.on('error', function (e) {
console.log(e);
});
})

gulp.task('dep:semantic',function(){
return gulp.src('node_modules/semantic-ui/dist/**/*')
.pipe(gulp.dest('public/lib/semantic-ui')).on('error',function(e){
console.log(e);
});
gulp.task('dep:semantic', function () {
return gulp
.src('node_modules/semantic-ui/dist/**/*')
.pipe(gulp.dest('public/lib/semantic-ui'))
.on('error', function (e) {
console.log(e);
});
})

gulp.task('dep:zepto',function(){
return gulp.src('node_modules/zepto/dist/**/*')
.pipe(gulp.dest('public/lib/zepto')).on('error',function(e){
console.log(e);
});
gulp.task('dep:zepto', function () {
return gulp
.src('node_modules/zepto/dist/**/*')
.pipe(gulp.dest('public/lib/zepto'))
.on('error', function (e) {
console.log(e);
});
})
6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@
"devDependencies": {
"gulp": "^3.9.1",
"gulp-plumber": "^1.1.0",
"gulp-stylus": "^2.6.0"
"gulp-rename": "^1.2.2",
"gulp-sourcemaps": "^2.4.1",
"gulp-strip-debug": "^1.1.0",
"gulp-stylus": "^2.6.0",
"gulp-uglify": "^2.1.0"
}
}
Loading

0 comments on commit 0c58ba8

Please sign in to comment.