Remove gulp (overkill)
This commit is contained in:
36
Gulpfile.js
36
Gulpfile.js
@@ -1,36 +0,0 @@
|
|||||||
var gulp = require("gulp")
|
|
||||||
var server = require("./tasks/server")
|
|
||||||
|
|
||||||
gulp.task("clean", require("./tasks/clean"))
|
|
||||||
|
|
||||||
// html
|
|
||||||
// @todo
|
|
||||||
|
|
||||||
// static assets
|
|
||||||
|
|
||||||
// generated assets
|
|
||||||
gulp.task("scripts:linting", require("./tasks/scripts-linting"))
|
|
||||||
gulp.task("scripts", ["scripts:linting"], require("./tasks/scripts"))
|
|
||||||
// gulp.task("stylesheets", require("./tasks/stylesheets"))
|
|
||||||
|
|
||||||
// build
|
|
||||||
// gulp.task("dist", ["clean", "static", "scripts", "stylesheets"])
|
|
||||||
gulp.task("dist", ["clean", "scripts"])
|
|
||||||
|
|
||||||
// publish
|
|
||||||
gulp.task("publish", ["dist"], require("./tasks/publish"))
|
|
||||||
|
|
||||||
// dev tasks
|
|
||||||
// gulp.task("server", ["dist"], server.start)
|
|
||||||
// gulp.task("default", ["dist", "server", "watch" ])
|
|
||||||
gulp.task("default", ["dist", "watch" ])
|
|
||||||
gulp.task("test", ["dist"])
|
|
||||||
|
|
||||||
gulp.task("watch", ["dist"], function() {
|
|
||||||
gulp.watch("./styles/**/*.css", ["stylesheets"])
|
|
||||||
gulp.watch("./scripts/**/*.js", ["scripts"])
|
|
||||||
gulp.watch("./tasks/**/*.js", ["scripts:linting"])
|
|
||||||
gulp.watch("./tests/**/*.js", ["scripts:linting"])
|
|
||||||
|
|
||||||
// gulp.watch("./dist/**/*").on("change", server.livereload)
|
|
||||||
})
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
var rimraf = require("rimraf")
|
|
||||||
|
|
||||||
module.exports = function() {
|
|
||||||
rimraf.sync("./dist")
|
|
||||||
}
|
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
/**
|
|
||||||
* parses cli arguments as options
|
|
||||||
*/
|
|
||||||
var options = require("minimist")(process.argv.slice(2))
|
|
||||||
var defaults = {
|
|
||||||
plumber: true,
|
|
||||||
minify: false
|
|
||||||
}
|
|
||||||
// set some defaults options depending on some flags
|
|
||||||
if (options.production) {
|
|
||||||
defaults.plumber = false
|
|
||||||
defaults.minify = true
|
|
||||||
}
|
|
||||||
|
|
||||||
options.plumber = options.plumber === undefined ? defaults.plumber: options.plumber
|
|
||||||
options.minify = options.minify === undefined ? defaults.minify: options.minify
|
|
||||||
|
|
||||||
module.exports = options
|
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
var gulp = require("gulp")
|
|
||||||
var ghPages = require("gulp-gh-pages")
|
|
||||||
|
|
||||||
/**
|
|
||||||
* publish task
|
|
||||||
*
|
|
||||||
* publish build in the gh-pages branch
|
|
||||||
*/
|
|
||||||
module.exports = function() {
|
|
||||||
return gulp.src("./dist/**/*")
|
|
||||||
.pipe(ghPages({
|
|
||||||
remoteUrl: "git@github.com:MoOx/pjax.git",
|
|
||||||
branch: "gh-pages",
|
|
||||||
cacheDir: __dirname + "/../.publish"
|
|
||||||
}))
|
|
||||||
}
|
|
||||||
@@ -1,24 +0,0 @@
|
|||||||
var gulp = require("gulp")
|
|
||||||
var opts = require("./options")
|
|
||||||
var util = require("gulp-util")
|
|
||||||
var plumber = require("gulp-plumber")
|
|
||||||
var jscs = require("gulp-jscs")
|
|
||||||
var jshint = require("gulp-jshint")
|
|
||||||
|
|
||||||
/**
|
|
||||||
* task scripts:linting
|
|
||||||
*
|
|
||||||
* jshint + jscs
|
|
||||||
*/
|
|
||||||
module.exports = function() {
|
|
||||||
return gulp.src([
|
|
||||||
"./src/scripts/**/*.js",
|
|
||||||
"!./src/scripts/lib/**/*.js",
|
|
||||||
"./tasks/**/*.js",
|
|
||||||
"./tests/**/*.js",
|
|
||||||
])
|
|
||||||
.pipe(opts.plumber ? plumber(): util.noop())
|
|
||||||
.pipe(jscs())
|
|
||||||
.pipe(jshint())
|
|
||||||
.pipe(jshint.reporter("jshint-stylish"))
|
|
||||||
}
|
|
||||||
@@ -1,27 +0,0 @@
|
|||||||
var gulp = require("gulp")
|
|
||||||
var util = require("gulp-util")
|
|
||||||
var plumber = require("gulp-plumber")
|
|
||||||
var browserify = require("gulp-browserify")
|
|
||||||
|
|
||||||
var opts = require("./options")
|
|
||||||
var transforms = [
|
|
||||||
// "jadeify",
|
|
||||||
// "debowerify",
|
|
||||||
// "decomponentify",
|
|
||||||
// "deglobalify",
|
|
||||||
// "es6ify"
|
|
||||||
]
|
|
||||||
if (opts.minify) {
|
|
||||||
transforms.push("uglifyify")
|
|
||||||
}
|
|
||||||
|
|
||||||
module.exports = function() {
|
|
||||||
return gulp.src("./src/scripts/*.js")
|
|
||||||
.pipe(opts.plumber ? plumber(): util.noop())
|
|
||||||
.pipe(browserify({
|
|
||||||
transform: transforms,
|
|
||||||
debug: opts.production !== undefined
|
|
||||||
}
|
|
||||||
))
|
|
||||||
.pipe(gulp.dest("./dist/scripts/"))
|
|
||||||
}
|
|
||||||
@@ -1,32 +0,0 @@
|
|||||||
var gulpUtil = require("gulp-util")
|
|
||||||
var connect = require("connect")
|
|
||||||
var connectLivereload = require("connect-livereload")
|
|
||||||
var livereload = require("gulp-livereload")
|
|
||||||
var opn = require("opn")
|
|
||||||
|
|
||||||
var livereloadServer
|
|
||||||
var ports = {
|
|
||||||
web: 2402,
|
|
||||||
livereload: 2403
|
|
||||||
}
|
|
||||||
|
|
||||||
module.exports = {
|
|
||||||
start: function() {
|
|
||||||
livereloadServer = livereload(ports.livereload)
|
|
||||||
|
|
||||||
var app = connect()
|
|
||||||
.use(connectLivereload({port: ports.livereload}))
|
|
||||||
.use(connect.static("./dist/"))
|
|
||||||
|
|
||||||
require("http").createServer(app)
|
|
||||||
.listen(ports.web)
|
|
||||||
.on("listening", function() {
|
|
||||||
gulpUtil.log("Started connect web server on http://localhost:" + ports.web + " and livereload server on http://localhost:" + ports.livereload)
|
|
||||||
})
|
|
||||||
|
|
||||||
opn("http://localhost:" + ports.web)
|
|
||||||
},
|
|
||||||
livereload: function(file) {
|
|
||||||
livereloadServer.changed(file.path)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
var symlink = require("gulp-symlink")
|
|
||||||
|
|
||||||
gulp.task("static", function() {
|
|
||||||
return gulp.src("./src/static/*")
|
|
||||||
.pipe(symlink("./dist/"))
|
|
||||||
})
|
|
||||||
@@ -1,44 +0,0 @@
|
|||||||
var gulp = require("gulp")
|
|
||||||
var opts = require("./options")
|
|
||||||
var util = require("gulp-util")
|
|
||||||
var plumber = require("gulp-plumber")
|
|
||||||
var rework = require("gulp-rework")
|
|
||||||
var reworkPlugins = {
|
|
||||||
imprt: require("rework-npm"),
|
|
||||||
// parent: require("rework-parent"),
|
|
||||||
// breakpoints: require("rework-breakpoints"),
|
|
||||||
vars: require("rework-vars"),
|
|
||||||
calc: require("rework-calc"),
|
|
||||||
// colorFn: require("rework-color-function"), // Tab Atkins's proposal color function in CSS
|
|
||||||
// hexAlpha: require("rework-hex-alpha"), // use 4-digit or 8-digit hex colors with alpha channels
|
|
||||||
// inline: require("rework-plugin-inline"),
|
|
||||||
// ieLimits: require("rework-ie-limits"),
|
|
||||||
// remFallback: require("rework-rem-fallback"),
|
|
||||||
// clearfix: require("rework-clearfix"),
|
|
||||||
}
|
|
||||||
var autoprefixer = require("gulp-autoprefixer")
|
|
||||||
|
|
||||||
module.exports = function() {
|
|
||||||
return gulp.src("./src/styles/*.css")
|
|
||||||
.pipe(opts.plumber ? plumber(): util.noop())
|
|
||||||
.pipe(rework(
|
|
||||||
reworkPlugins.imprt("./src/css"),
|
|
||||||
rework.colors(),
|
|
||||||
rework.references(),
|
|
||||||
// reworkPlugins.parent,
|
|
||||||
// reworkPlugins.breakpoints,
|
|
||||||
reworkPlugins.vars(),
|
|
||||||
reworkPlugins.calc,
|
|
||||||
//reworkPlugins.colorFn,
|
|
||||||
//reworkPlugins.hexAlpha,
|
|
||||||
//reworkPlugins.inline,
|
|
||||||
//reworkPlugins.ieLimits,
|
|
||||||
//reworkPlugins.remFallback,
|
|
||||||
// reworkPlugins.clearfix,
|
|
||||||
// rework.ease(),
|
|
||||||
// rework.extend(),
|
|
||||||
{sourcemap: !option.minify}
|
|
||||||
))
|
|
||||||
.pipe(autoprefixer())
|
|
||||||
.pipe(gulp.dest(paths.dist.stylesheets))
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user