Skip to content

Commit

Permalink
fix: remove gulp-util
Browse files Browse the repository at this point in the history
  • Loading branch information
tavyandy97 committed Sep 8, 2022
1 parent 25de316 commit 805d385
Show file tree
Hide file tree
Showing 3 changed files with 80 additions and 626 deletions.
26 changes: 13 additions & 13 deletions gulpfile.babel.js
Original file line number Diff line number Diff line change
@@ -1,39 +1,39 @@
import gulp from "gulp";
import loadPlugins from "gulp-load-plugins";
import webpack from "webpack";
import rimraf from "rimraf";

const plugins = loadPlugins();
import log from "fancy-log";
import PluginError from "plugin-error";
import rename from "gulp-rename";

import popupWebpackConfig from "./popup/webpack.config";
import eventWebpackConfig from "./event/webpack.config";
import contentWebpackConfig from "./content/webpack.config";

const popupJs = (cb) => {
webpack(popupWebpackConfig, (err, stats) => {
if (err) throw new plugins.util.PluginError("webpack", err);
if (err) throw new PluginError("webpack", err);

plugins.util.log("[webpack]", stats.toString());
log("[webpack]", stats.toString());

cb();
});
};

const eventJs = (cb) => {
webpack(eventWebpackConfig, (err, stats) => {
if (err) throw new plugins.util.PluginError("webpack", err);
if (err) throw new PluginError("webpack", err);

plugins.util.log("[webpack]", stats.toString());
log("[webpack]", stats.toString());

cb();
});
};

const contentJs = (cb) => {
webpack(contentWebpackConfig, (err, stats) => {
if (err) throw new plugins.util.PluginError("webpack", err);
if (err) throw new PluginError("webpack", err);

plugins.util.log("[webpack]", stats.toString());
log("[webpack]", stats.toString());

cb();
});
Expand All @@ -42,7 +42,7 @@ const contentJs = (cb) => {
const popupHtml = () => {
return gulp
.src("popup/src/index.html")
.pipe(plugins.rename("popup.html"))
.pipe(rename("popup.html"))
.pipe(gulp.dest("./build"));
};

Expand Down Expand Up @@ -73,12 +73,12 @@ const build = gulp.series(
popupJs,
popupHtml,
eventJs,
contentJs,
),
contentJs
)
);

gulp.task("watch", () =>
gulp.watch(["popup/**/*", "content/**/*", "event/**/*"], build),
gulp.watch(["popup/**/*", "content/**/*", "event/**/*"], build)
);

gulp.task("default", build);
Loading

0 comments on commit 805d385

Please sign in to comment.