-
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
Showing
7 changed files
with
7,842 additions
and
5,271 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
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,43 @@ | ||
var gulp = require("gulp"); | ||
var util = require("gulp-util"); | ||
var rename = require("gulp-rename"); | ||
var filter = require("gulp-filter"); | ||
var sourcemaps = require("gulp-sourcemaps"); | ||
var uglifyjs = require("uglify-js"); | ||
var composer = require("gulp-uglify/composer"); | ||
var pump = require("pump"); | ||
var glob = require("glob"); | ||
var changeCase = require("change-case"); | ||
var browserify = require("browserify"); | ||
var source = require("vinyl-source-stream"); | ||
var buffer = require("vinyl-buffer"); | ||
var fabricator = require("gulp-fabricator"); | ||
const gulp = require("gulp"); | ||
const rename = require("gulp-rename"); | ||
const filter = require("gulp-filter"); | ||
const sourcemaps = require("gulp-sourcemaps"); | ||
const uglifyjs = require("uglify-js"); | ||
const composer = require("gulp-uglify/composer"); | ||
const pump = require("pump"); | ||
const glob = require("glob"); | ||
const changeCase = require("change-case"); | ||
const browserify = require("browserify"); | ||
const source = require("vinyl-source-stream"); | ||
const buffer = require("vinyl-buffer"); | ||
const fabricator = require("gulp-fabricator"); | ||
|
||
fabricator.setup({ | ||
name: "Change Case", | ||
js: { | ||
source: ["src/change-case.js"] | ||
}, | ||
base: { | ||
directory: __dirname | ||
} | ||
}); | ||
|
||
gulp.task("build:js", function(callback) { | ||
gulp.task("browserify", function(callback) { | ||
pump([ | ||
browserify({ | ||
entries: glob.sync(fabricator.config.js.source[0]), | ||
standalone: changeCase.camel(fabricator.config.name), | ||
standalone: changeCase.camelCase(fabricator.config.name), | ||
debug: true | ||
}) | ||
.bundle() | ||
.on("error", util.log.bind(util, "Browserify Error")) | ||
.pipe(source(changeCase.param(fabricator.config.name) + "-bundled.js").on("error", util.log)) | ||
.pipe(source(changeCase.paramCase(fabricator.config.name) + "-bundled.js")) | ||
.pipe(buffer()) | ||
.pipe(sourcemaps.init({ loadMaps: true })) | ||
.pipe(sourcemaps.write("./")) | ||
.pipe(gulp.dest(fabricator.config.js.destination).on("error", util.log)) | ||
.pipe(gulp.dest(fabricator.config.js.destination)) | ||
.pipe(filter([fabricator.config.js.destination + "*.js", "!*.min.js", "!*.map"])) | ||
.pipe(rename({ extname: ".min.js" }).on("error", util.log)), | ||
composer(uglifyjs, console)({ mangle: false }).on("error", util.log), | ||
gulp.dest(fabricator.config.js.destination).on("error", util.log) | ||
.pipe(rename({ extname: ".min.js" })), | ||
composer(uglifyjs, console)({ mangle: false }), | ||
gulp.dest(fabricator.config.js.destination) | ||
], callback); | ||
}); |
Oops, something went wrong.