Skip to content

Commit

Permalink
Update tasks in gulpfile
Browse files Browse the repository at this point in the history
  • Loading branch information
jmjuanes committed Jan 14, 2022
1 parent 88dcdf3 commit 8cdcac5
Showing 1 changed file with 18 additions and 21 deletions.
39 changes: 18 additions & 21 deletions gulpfile.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
const path = require("path");
const autoprefixer = require("autoprefixer");
const gulp = require("gulp");
const postcss = require("gulp-postcss");
Expand All @@ -6,17 +7,17 @@ const rename = require("gulp-rename");
const bundle = require("./scripts/bundle.js");
const css = require("./scripts/css.js");
const icons = require("./scripts/icons.js");
const upgrade = require("./scripts/upgrade.js");
const paths = require("./paths.js");
const pkg = require("./package.json");
// const pkg = require("./package.json");

// Clean output directories
gulp.task("clean", () => null);

// Build bundle files
gulp.task("build:bundle", () => {
return gulp.src("bundle.config.js")
.pipe(bundle())
return gulp.src("config/bundle.json")
.pipe(bundle({
cwd: __dirname,
}))
.pipe(gulp.dest("dist/"));
});

Expand All @@ -28,23 +29,28 @@ gulp.task("build:components", () => {
// Build icons fonts
gulp.task("build:icons", () => {
return gulp.src("config/icons.json")
.pipe(icons())
.pipe(gulp.dest("dist/fonts/"));
.pipe(icons({
cwd: __dirname,
iconsFolder: path.join(__dirname, "icons"),
}))
.pipe(gulp.dest("dist/"));
});

// Generate dist files
gulp.task("dist", () => {
// Generate css files
gulp.task("build:css", () => {
return gulp.src("siimple.config.scss")
.pipe(css.compile({}))
.pipe(css.compile({
loadPaths: [__dirname],
}))
.pipe(postcss([autoprefixer()]))
.pipe(rename("siimple.css"))
.pipe(gulp.dest("dist/css/"))
.pipe(gulp.dest("dist/"))
.pipe(css.minify({
"compatibility": "*",
"level": 2,
}))
.pipe(rename("siimple.min.css"))
.pipe(gulp.dest("dist/css/"));
.pipe(gulp.dest("dist/"));
});

// Build documentaation styles
Expand Down Expand Up @@ -73,12 +79,3 @@ gulp.task("docs:fonts", () => {
gulp.task("docs:assets", () => {
return gulp.src("src/assets/*").pipe(gulp.dest("public/"));
});

// Upgrade package.json files
gulp.task("upgrade", () => {
return gulp.src("packages/*/package.json")
.pipe(upgrade({
"packages": pkg.packages,
}))
.pipe(gulp.dest(file => file.base));
});

0 comments on commit 8cdcac5

Please sign in to comment.