mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-10 18:25:37 +02:00
[ESM] Convert the "wintersmith"-task to use import()
syntax
This commit is contained in:
parent
5696c3aa3a
commit
ac3661972b
1 changed files with 17 additions and 14 deletions
11
gulpfile.js
11
gulpfile.js
|
@ -2039,12 +2039,14 @@ function ghPagesPrepare() {
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
gulp.task("wintersmith", function (done) {
|
gulp.task("wintersmith", async function () {
|
||||||
const wintersmith = require("wintersmith");
|
const { default: wintersmith } = await import("wintersmith");
|
||||||
const env = wintersmith("docs/config.json");
|
const env = wintersmith("docs/config.json");
|
||||||
|
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
env.build(GH_PAGES_DIR, function (error) {
|
env.build(GH_PAGES_DIR, function (error) {
|
||||||
if (error) {
|
if (error) {
|
||||||
done(error);
|
reject(error);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2055,7 +2057,8 @@ gulp.task("wintersmith", function (done) {
|
||||||
);
|
);
|
||||||
|
|
||||||
console.log("Done building with wintersmith.");
|
console.log("Done building with wintersmith.");
|
||||||
done();
|
resolve();
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue