-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3445c78
commit be3af8e
Showing
13 changed files
with
851 additions
and
532 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
scp -r dist/hotspot/ admin@192.168.0.102:/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,77 @@ | ||
const { src, dest, watch, series } = require('gulp') | ||
const { | ||
src, | ||
dest, | ||
watch, | ||
series | ||
} = require('gulp') | ||
const pug = require('gulp-pug') | ||
const sass = require('gulp-sass') | ||
const htmlmin = require('gulp-htmlmin'); | ||
const browserSync = require('browser-sync').create() | ||
const minify = require('gulp-minify'); | ||
|
||
// Compile pug files into HTML | ||
function html() { | ||
return src('src/hotspot/**/*') | ||
.pipe(pug()) | ||
.pipe(dest('dist/hotspot/')) | ||
return src('src/hotspot/**/*.pug') | ||
.pipe(pug()) | ||
.pipe(dest('dist/hotspot/')) | ||
} | ||
// // Copy assets | ||
// // add xml copy to dist dir | ||
// function assets() { | ||
// return src('src/assets/**/*') | ||
// .pipe(dest('dist/hotspot/assets')) | ||
// } | ||
|
||
function minifiedhtml() { | ||
return src('dist/hotspot/**/*.html') | ||
.pipe(htmlmin({ | ||
collapseWhitespace: true | ||
})) | ||
.pipe(dest('dist/hotspot/')) | ||
} | ||
|
||
// Copy assets | ||
// add xml copy to dist dir | ||
function assets() { | ||
return src('src/assets/**/*') | ||
.pipe(dest('dist/hotspot/assets')) | ||
} | ||
|
||
//Compile sass files into CSS | ||
function styles() { | ||
return src('src/scss/theme.scss') | ||
.pipe(sass({ | ||
includePaths: ['src/scss'], | ||
errLogToConsole: true, | ||
outputStyle: 'compressed', | ||
onError: browserSync.notify | ||
})) | ||
.pipe(dest('dist/hotspot/assets/css')) | ||
.pipe(browserSync.stream()) | ||
return src('src/scss/theme.scss') | ||
.pipe(sass({ | ||
includePaths: ['src/scss'], | ||
errLogToConsole: true, | ||
outputStyle: 'compressed', | ||
onError: browserSync.notify | ||
})) | ||
.pipe(dest('dist/hotspot/assets/css')) | ||
} | ||
|
||
//Compile sass files into CSS | ||
function minjs() { | ||
return src('src/assets/pagos/*.js') | ||
.pipe(minify({ | ||
ext: { | ||
src: '-debug.js', | ||
min: '.js' | ||
}, | ||
exclude: ['vue.js'], | ||
ignoreFiles: ['.combo.js', '-min.js'] | ||
})) | ||
.pipe(dest('dist/hotspot/assets/pagos')) | ||
} | ||
|
||
// Serve and watch sass/pug files for changes | ||
function watchAndServe() { | ||
browserSync.init({ | ||
server: 'dist/hotspot/', | ||
}) | ||
|
||
watch('src/sass/**/*.scss', styles) | ||
watch('src/**/*', html) | ||
watch('dist/hotspot/*.html').on('change', browserSync.reload) | ||
browserSync.init({ | ||
server: 'dist/hotspot/', | ||
}) | ||
watch('src/sass/**/*', styles) | ||
watch('src/assets/pagos/**/*', minjs) | ||
watch(['src/**/*.pug', 'src/**/*.html'], html, minifiedhtml) | ||
watch('dist/hotspot/**/*.*').on('change', browserSync.reload) | ||
} | ||
|
||
exports.html = html | ||
exports.minifiedhtml = minifiedhtml | ||
exports.js = minjs | ||
exports.styles = styles | ||
exports.watch = watchAndServe | ||
exports.default = series(html, styles, watchAndServe) | ||
exports.default = series(html, minifiedhtml, assets, minjs, styles, watchAndServe) |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.