This repository has been archived by the owner on Apr 3, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 45
/
gulpfile.js
74 lines (66 loc) · 2.64 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
"use strict";
const
gulp = require("gulp"),
imagemin = require('gulp-imagemin'),
elixir = require("laravel-elixir"),
sourcemaps = require('gulp-sourcemaps'),
rollup = require('rollup-stream'),
typescript = require('rollup-plugin-typescript'),
babel = require("rollup-plugin-babel"),
uglify = require('rollup-plugin-uglify'),
source = require('vinyl-source-stream'),
modernizr = require('gulp-modernizr');
elixir.config.sourcemaps = true;
const vendor_scripts = [
"../../../node_modules/jquery/dist/jquery.js",
"../../../node_modules/@claviska/jquery-dropdown/jquery.dropdown.js",
"../../../node_modules/jquery-modal/jquery.modal.js",
"../../../node_modules/jquery.cookie/jquery.cookie.js",
"../../../node_modules/Stepper/jquery.fs.stepper.js",
"../../../node_modules/hideshowpassword/hideShowPassword.js",
"../../../node_modules/jquery-powertip/dist/jquery.powertip.js",
"../../../node_modules/dropit/dist/dropit.js",
"../../../node_modules/dropzone/dist/dropzone.js",
"../../../node_modules/datetimepicker/dist/DateTimePicker.js",
"../../../node_modules/autosize/dist/autosize.js",
"../../../node_modules/jquery-jcrop/js/jquery.color.js",
"../../../node_modules/jquery-jcrop/js/jquery.Jcrop.js",
"../../../node_modules/lang.js/src/lang.js"
];
gulp.task("images", () => {
gulp.src("resources/assets/images/**/*")
.pipe(imagemin())
.pipe(gulp.dest("public/assets/images"));
});
gulp.task("typescript", () => {
return rollup({
input: 'resources/assets/typescript/mybb.ts',
format: 'iife',
sourcemap: 'inline',
plugins: [
typescript(),
babel({
exclude: 'node_modules/**',
}),
//uglify()
]
}).pipe(source('mybb.js'))
.pipe(gulp.dest('./public/assets/js'));
});
gulp.task("modernizr", function() {
gulp.src('./public/assets/**/*.js')
.pipe(modernizr())
.pipe(gulp.dest("./public/assets/js/"))
});
elixir(mix => {
mix.sass("main.scss", "public/assets/css/main.css")
.sass("admin.scss", "public/assets/css/admin.css")
.sass("main.rtl.scss", "public/assets/css/rtl.css")
.sass("admin.rtl.scss", "public/assets/css/admin_rtl.css")
.copy("node_modules/font-awesome/fonts", "public/assets/fonts")
.task("images", "resources/assets/images/**/*")
.scripts(vendor_scripts, "public/assets/js/vendor.js")
.task("typescript", "resources/assets/typescript/**/*")
// Run modernizr last as it analyses our JS files
.task("modernizr");
});