Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed gulpfile.js & package.json, now it works! #66

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions spectrogram/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
node_modules/
build/
package-lock.json
179 changes: 92 additions & 87 deletions spectrogram/gulpfile.js
Original file line number Diff line number Diff line change
@@ -1,116 +1,121 @@
// -----------------------------------------------------------
var gulp = require('gulp'),
sass = require('gulp-sass'),
autoPrefixer = require('gulp-autoprefixer'),
minifyCSS = require('gulp-minify-css'),
browserify = require('gulp-browserify'),
uglify = require('gulp-uglify'),
concat = require('gulp-concat'),
copy = require('gulp-copy'),
livereload = require('gulp-livereload'),
jade = require('gulp-jade'),
imagemin = require('gulp-imagemin'),
cache = require('gulp-cache'),
webserver = require('gulp-webserver'),
iconfont = require('gulp-iconfont'),
iconfontCss = require('gulp-iconfont-css');
const gulp = require('gulp');
const sass = require('gulp-sass')(require('sass'));
const autoPrefixer = require('gulp-autoprefixer');
const cleanCSS = require('gulp-clean-css');
const browserify = require('browserify');
const source = require('vinyl-source-stream');
const buffer = require('vinyl-buffer');
const uglify = require('gulp-uglify');
const concat = require('gulp-concat');
const copy = require('gulp-copy');
const livereload = require('gulp-livereload');
const pug = require('gulp-pug');
const imagemin = require('gulp-imagemin');
const cache = require('gulp-cache');
const webserver = require('gulp-webserver');
const iconfont = require('gulp-iconfont');
const iconfontCss = require('gulp-iconfont-css');
// -----------------------------------------------------------


gulp.task('sass', function() {
gulp.src("src/sass/*.scss")
.pipe(sass())
.on('error', function(error) {
console.log(error);
this.emit('end');
})
.pipe(autoPrefixer())
.pipe(minifyCSS())
.pipe(gulp.dest("build/css"));
gulp.task('sass', function () {
return gulp.src("src/sass/*.scss")
.pipe(sass())
.on('error', function (error) {
console.log(error);
this.emit('end');
})
.pipe(autoPrefixer())
.pipe(cleanCSS())
.pipe(gulp.dest("build/css"));
});
gulp.task('templates', function() {
gulp.src('src/jade/**/*.jade')
.pipe(jade({}))
.on('error', function(error) {
console.log(error);
this.emit('end');
})
.pipe(gulp.dest('./build'))

gulp.task('templates', function () {
return gulp.src('src/jade/**/*.jade')
.pipe(pug({}))
.on('error', function (error) {
console.log(error);
this.emit('end');
})
.pipe(gulp.dest('./build'))
});
gulp.task('images', function() {

gulp.task('images', function () {
return gulp.src('./src/images/**/*')
.pipe(cache(
imagemin(
{
optimizationLevel: 3,
progressive: true,
interlaced: true
}
)
imagemin(
{
optimizationLevel: 3,
progressive: true,
interlaced: true
}
)
))
.pipe(gulp.dest('./build/img'));
});
gulp.task('browserify', function() {
gulp.src(['src/javascripts/main.js'])
.pipe(browserify({
insertGlobals: true,
debug: true
}))
.on('error', function(error) {
console.log(error);
this.emit('end');
})
.pipe(uglify())
.pipe(concat('app.js'))
.pipe(gulp.dest('build/js'));

gulp.task('browserify', function () {
return browserify('src/javascripts/main.js', { debug: true })
.bundle()
.on('error', function (error) {
console.log(error);
this.emit('end');
})
.pipe(source('app.js'))
.pipe(buffer())
.pipe(uglify())
.pipe(gulp.dest('build/js'));
});

gulp.task('bundle-libs', function() {
gulp.task('bundle-libs', function () {
return gulp.src('src/javascripts/o3djs/*.js')
.pipe(concat('bundle.js'))
// .pipe(uglify())
.pipe(gulp.dest('build/js'));
});

gulp.task('insert-bin',function(){
return gulp.src('src/bin/**')
.pipe(copy('build/bin',{
prefix:2
}));
gulp.task('insert-bin', function () {
return gulp.src('src/bin/**')
.pipe(copy('build/bin', {
prefix: 2
}));
});

gulp.task('iconfont', function(){
gulp.src(['src/icons/*.svg'])
.pipe(iconfontCss({
fontName: "icons",
path: 'src/assets/templates/_icons.scss',
targetPath: '../../../../src/sass/fonts/_icons.scss',
fontPath: '../bin/fonts/icons/'
}))
.pipe(iconfont({
fontName: "icons",
normalize: true
}))
.pipe(gulp.dest('build/bin/fonts/icons/'));
gulp.task('iconfont', function (done) {
gulp.src(['src/icons/*.svg'])
.pipe(iconfontCss({
fontName: "icons",
path: 'src/assets/templates/_icons.scss',
targetPath: '../../../../src/sass/fonts/_icons.scss',
fontPath: '../bin/fonts/icons/'
}))
.pipe(iconfont({
fontName: "icons",
normalize: true
}))
.pipe(gulp.dest('build/bin/fonts/icons/'))
.on('end', done);
});

gulp.task('webserver', function() {
gulp.src('./build')
gulp.task('webserver', function () {
return gulp.src('./build')
.pipe(webserver({
livereload: true,
open: true,
fallback: 'index.html'
}));
});
gulp.task('watch', function() {
gulp.watch("src/icons/**/*.svg", ['iconfont' ]);
gulp.watch("src/assets/**/*", ['iconfont' ]);
gulp.watch("src/sass/**/*", ['sass' ]);
gulp.watch('src/jade/**/*.jade', ['templates' ]);
gulp.watch('src/javascripts/**', ['browserify' ]);
gulp.watch('src/javascripts/lib/**', ['bundle-libs' ]);
gulp.watch('src/images/**', ['images' ]);
gulp.watch('src/bin/**', ['insert-bin' ]);

gulp.task('watch', function () {
gulp.watch("src/icons/**/*.svg", gulp.series('iconfont'));
gulp.watch("src/assets/**/*", gulp.series('iconfont'));
gulp.watch("src/sass/**/*", gulp.series('sass'));
gulp.watch('src/jade/**/*.jade', gulp.series('templates'));
gulp.watch('src/javascripts/**', gulp.series('browserify'));
gulp.watch('src/javascripts/lib/**', gulp.series('bundle-libs'));
gulp.watch('src/images/**', gulp.series('images'));
gulp.watch('src/bin/**', gulp.series('insert-bin'));
});
gulp.task('build-all',['iconfont','sass','templates','browserify','bundle-libs','images','insert-bin']);
gulp.task('default',['watch','webserver']);

gulp.task('build-all', gulp.parallel('iconfont', 'sass', 'templates', 'browserify', 'bundle-libs', 'images', 'insert-bin'));
gulp.task('default', gulp.parallel('watch', 'webserver'));
46 changes: 25 additions & 21 deletions spectrogram/package.json
Original file line number Diff line number Diff line change
@@ -1,25 +1,29 @@
{
"version": "0.0.0",
"author": "Jeramy Morrill",
"version": "0.0.1",
"author": "Jeramy Morrill & Alexshcer",
"devDependencies": {
"gulp": "^3.8.11",
"gulp-autoprefixer": "^2.1.0",
"gulp-browserify": "^0.5.1",
"gulp-cache": "^0.2.4",
"gulp-clean": "^0.3.1",
"gulp-compass": "^2.0.3",
"gulp-concat": "^2.4.3",
"gulp-copy": "0.0.2",
"gulp-iconfont": "^5.0.1",
"gulp-iconfont-css": "^2.0.0",
"gulp-imagemin": "^2.2.0",
"gulp-jade": "^0.11.0",
"gulp-livereload": "^3.7.0",
"gulp-minify-css": "^0.4.5",
"gulp-r": "^1.1.2",
"gulp-sass": "^2.1.1",
"gulp-uglify": "^1.1.0",
"gulp-webserver": "^0.9.0",
"jquery": "^2.1.3"
"browserify": "^17.0.0",
"gulp": "^4.0.2",
"gulp-autoprefixer": "^8.0.0",
"gulp-cache": "^1.1.3",
"gulp-clean-css": "^4.3.0",
"gulp-concat": "^2.6.1",
"gulp-copy": "^4.0.1",
"gulp-iconfont": "^11.0.1",
"gulp-iconfont-css": "^3.0.0",
"gulp-imagemin": "^7.1.0",
"gulp-livereload": "^4.0.2",
"gulp-pug": "^5.0.0",
"gulp-sass": "^5.1.0",
"gulp-uglify": "^3.0.2",
"gulp-webserver": "^0.9.1",
"jquery": "^3.6.4",
"node-sass": "^8.0.0",
"sass": "^1.62.1",
"vinyl-buffer": "^1.0.1",
"vinyl-source-stream": "^2.0.0"
},
"dependencies": {
"lodash": "^4.17.21"
}
}
Loading