forked from awaken1ng/bd-linestickers
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
40 lines (34 loc) · 1.26 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
38
39
40
const package = require('./package.json');
const gulp = require('gulp');
const sass = require('gulp-sass');
const concat = require('gulp-concat-util');
const pump = require('pump');
const source = 'source';
const entry = source + '/*.js';
const name = 'lineemotes.plugin.js';
const betterdiscord = process.env.appdata + '/BetterDiscord/plugins/';
const build = 'dist';
const deploy = true; // copy built plugin directly into BetterDiscord
gulp.task('build', ['build:css'], function (callback) {
var tasks = [
gulp.src(entry),
concat(name),
concat.footer(`lineemotes.prototype.getVersion = () => "${package.version}";`),
gulp.dest(build)
]
if (deploy) {
tasks.push(gulp.dest(betterdiscord))
}
pump(tasks, callback);
});
gulp.task('build:css', function () {
return gulp.src('stylesheet/stylesheet.scss')
.pipe(sass().on('error', sass.logError))
.pipe(concat('_stylesheet.js'))
.pipe(concat.header('lineemotes.getStylesheet = function () { \nvar stylesheet = `'))
.pipe(concat.footer('` \nreturn "<style>" + stylesheet + "</style>"; \n};\n'))
.pipe(gulp.dest(source));
});
gulp.task('build:watch', function () {
gulp.watch(entry, ['build']);
});