Swapping out Grunt for Gulp
This commit is contained in:
parent
8cd47d7e70
commit
31b8404be1
65
Gruntfile.js
65
Gruntfile.js
@ -1,65 +0,0 @@
|
|||||||
module.exports = function(grunt) {
|
|
||||||
|
|
||||||
// Project configuration.
|
|
||||||
grunt.initConfig({
|
|
||||||
pkg: grunt.file.readJSON('package.json'),
|
|
||||||
|
|
||||||
sass: {
|
|
||||||
dist: {
|
|
||||||
options: {
|
|
||||||
style: 'compressed'
|
|
||||||
},
|
|
||||||
files: [{
|
|
||||||
expand: true,
|
|
||||||
cwd: 'assets/styles',
|
|
||||||
src: ['**/*.sass'],
|
|
||||||
dest: 'public/css',
|
|
||||||
ext: '.css'
|
|
||||||
}]
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
coffee: {
|
|
||||||
options: {
|
|
||||||
sourceMap: true,
|
|
||||||
style: 'compressed'
|
|
||||||
},
|
|
||||||
files: {
|
|
||||||
expand: true,
|
|
||||||
flatten: true,
|
|
||||||
cwd: 'assets/scripts',
|
|
||||||
src: ['*.coffee'],
|
|
||||||
dest: 'public/js',
|
|
||||||
ext: '.js'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
watch: {
|
|
||||||
css: {
|
|
||||||
files: ['assets/styles/**/*.sass'],
|
|
||||||
tasks: ['sass'],
|
|
||||||
options: {
|
|
||||||
atBegin: true,
|
|
||||||
spawn: false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
js: {
|
|
||||||
files: ['assets/scripts/**/*.coffee'],
|
|
||||||
tasks: ['coffee'],
|
|
||||||
options: {
|
|
||||||
atBegin: true,
|
|
||||||
spawn: false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
// Load plugins.
|
|
||||||
grunt.loadNpmTasks('grunt-contrib-watch');
|
|
||||||
grunt.loadNpmTasks('grunt-contrib-sass');
|
|
||||||
grunt.loadNpmTasks('grunt-contrib-coffee');
|
|
||||||
|
|
||||||
// CLI tasks.
|
|
||||||
grunt.registerTask('default', ['sass', 'coffee']);
|
|
||||||
|
|
||||||
};
|
|
39
gulpfile.js
Normal file
39
gulpfile.js
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
const gulp = require('gulp');
|
||||||
|
const sass = require('gulp-sass')(require('sass'));
|
||||||
|
const coffee = require('gulp-coffee');
|
||||||
|
const sourcemaps = require('gulp-sourcemaps');
|
||||||
|
const plumber = require('gulp-plumber');
|
||||||
|
|
||||||
|
// Compile .sass files to compressed CSS
|
||||||
|
function compileSass() {
|
||||||
|
return gulp.src('assets/styles/**/*.sass')
|
||||||
|
.pipe(plumber())
|
||||||
|
.pipe(sass({ outputStyle: 'compressed' }).on('error', sass.logError))
|
||||||
|
.pipe(gulp.dest('public/css'));
|
||||||
|
}
|
||||||
|
|
||||||
|
// Compile .coffee files to JavaScript with source maps
|
||||||
|
function compileCoffee() {
|
||||||
|
return gulp.src('assets/scripts/*.coffee', { sourcemaps: true })
|
||||||
|
.pipe(plumber())
|
||||||
|
.pipe(coffee({ bare: true }))
|
||||||
|
.pipe(gulp.dest('public/js', { sourcemaps: '.' }));
|
||||||
|
}
|
||||||
|
|
||||||
|
// Watch files for changes
|
||||||
|
function watchFiles() {
|
||||||
|
gulp.watch('assets/styles/**/*.sass', compileSass);
|
||||||
|
gulp.watch('assets/scripts/**/*.coffee', compileCoffee);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Define default task
|
||||||
|
exports.default = gulp.series(
|
||||||
|
gulp.parallel(compileSass, compileCoffee),
|
||||||
|
watchFiles
|
||||||
|
);
|
||||||
|
|
||||||
|
// one-time build
|
||||||
|
exports.build = gulp.parallel(compileSass, compileCoffee);
|
||||||
|
|
||||||
|
// start builds with file watching
|
||||||
|
exports.watch = watchFiles;
|
3004
package-lock.json
generated
3004
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
14
package.json
14
package.json
@ -4,7 +4,7 @@
|
|||||||
"version": "0.1.0",
|
"version": "0.1.0",
|
||||||
"main": "src/server.rb",
|
"main": "src/server.rb",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"grunt": "grunt"
|
"gulp": "gulp"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
@ -18,11 +18,11 @@
|
|||||||
"author": "Gregory Ballantine <gballantine@bitgoblin.tech>",
|
"author": "Gregory Ballantine <gballantine@bitgoblin.tech>",
|
||||||
"license": "BSD-2-Clause",
|
"license": "BSD-2-Clause",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"grunt": "^1.6.1",
|
"gulp": "^5.0.1",
|
||||||
"grunt-cli": "^1.4.3",
|
"gulp-coffee": "^3.0.3",
|
||||||
"grunt-contrib-coffee": "^2.1.0",
|
"gulp-plumber": "^1.2.1",
|
||||||
"grunt-contrib-sass": "^2.0.0",
|
"gulp-sass": "^6.0.1",
|
||||||
"grunt-contrib-watch": "^1.1.0",
|
"gulp-sourcemaps": "^3.0.0",
|
||||||
"sass": "^1.77.4"
|
"sass": "^1.89.2"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user