-
Notifications
You must be signed in to change notification settings - Fork 2
/
gulpfile.js
38 lines (31 loc) · 1.04 KB
/
gulpfile.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
var fs = require("fs");
var gulp = require('gulp');
var browserify = require("browserify");
var buffer = require("gulp-buffer");
var replace = require("gulp-replace");
var source = require("vinyl-source-stream");
var babelify = require("babelify");
gulp.task("bundle-amd", function () {
// Build dist/amd/sticky-elements.js
browserify('tiki/js/sticky-elements', {
debug: false,
standalone: 'StickyElements',
bundleExternal: false
})
.transform(babelify)
.bundle()
.on("error", function (err) { console.log(err.message); })
.pipe(source("sticky-elements.js"))
.pipe(buffer())
.pipe(replace(/define\.amd\)\{define\(\[\]/, 'define.amd){define(["jquery","underscore","events"]'))
.pipe(gulp.dest('./dist/amd'));
// Build dist/amd/events.js
browserify('node_modules/events/events', {
debug: false,
standalone: 'Events',
bundleExternal: false
})
.bundle()
.on("error", function (err) { console.log(err.message); })
.pipe(fs.createWriteStream("./dist/amd/events.js"));
});