| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384 |
- var gulp = require("gulp");
- var sass = require("gulp-sass");
- var autoprefixer = require("gulp-autoprefixer");
- var cleancss = require("gulp-clean-css");
- var rename = require("gulp-rename");
- var input = "scss/*.scss";
- var output = "public/css";
- var sassOptions = {
- "errLogToConsole": true,
- "outputStyle": "expanded"
- };
- var autoprefixerOptions = {
- "browsers": ["last 2 versions", "ie >= 9", "and_chr >= 2.3"]
- };
- var vendorCssFiles = [
- "./node_modules/datatables.net-bs4/css/dataTables.bootstrap4.min.css",
- "./node_modules/datatables.net-buttons-bs4/css/buttons.bootstrap4.min.css",
- "./node_modules/datatables.net-responsive-bs4/css/responsive.bootstrap4.min.css",
- "./node_modules/daterangepicker/daterangepicker.css",
- ];
- var jsFiles = [
- "./node_modules/jquery/dist/jquery.min.*",
- "./node_modules/bootstrap/dist/js/bootstrap.min.*",
- "./node_modules/popper.js/dist/umd/popper.min.*",
- "./node_modules/chart.js/dist/Chart.bundle.min.js",
- "./node_modules/chartjs-plugin-datalabels/dist/chartjs-plugin-datalabels.min.js",
- "./node_modules/clipboard/dist/clipboard.min.js",
- "./node_modules/@fortawesome/fontawesome-pro/js/all.min.js",
- "./node_modules/@google/markerclusterer/src/markerclusterer.js",
- "./node_modules/datatables.net/js/jquery.dataTables.min.js",
- "./node_modules/datatables.net-buttons/js/dataTables.buttons.min.js",
- "./node_modules/datatables.net-responsive/js/dataTables.responsive.min.js",
- "./node_modules/datatables.net-bs4/js/dataTables.bootstrap4.min.js",
- "./node_modules/datatables.net-buttons-bs4/js/buttons.bootstrap4.min.js",
- "./node_modules/datatables.net-responsive-bs4/js/responsive.bootstrap4.min.js",
- "./node_modules/moment/min/moment.min.js",
- "./node_modules/daterangepicker/daterangepicker.js",
- ];
- gulp.task("copy-vendor-css", function() {
- return gulp.src(vendorCssFiles).pipe(gulp.dest("./public/css"));
- });
- gulp.task("copy-js", function() {
- return gulp.src(jsFiles).pipe(gulp.dest("./public/js"));
- });
- gulp.task("sass", function() {
- return gulp
- .src(input)
- .pipe(sass(sassOptions).on("error", sass.logError))
- .pipe(autoprefixer(autoprefixerOptions))
- .pipe(cleancss())
- .pipe(rename({
- "suffix": ".min"
- }))
- .pipe(gulp.dest(output));
- });
- gulp.task("watch", function() {
- gulp.watch(jsFiles, gulp.series("copy-js"))
- .on("change", function(event) {
- console.log("File " + event.path + " was " + event.type + ", running 'copy-js' task...");
- });
- return gulp
- .watch(input, gulp.series("sass"))
- .on("change", function(event) {
- console.log("File " + event.path + " was " + event.type + ", running 'sass' task...");
- })
- });
- gulp.task("default", gulp.series("sass", "copy-vendor-css", "copy-js", "watch"));
|