Skip to content
This repository has been archived by the owner on Apr 8, 2023. It is now read-only.

builder.js not firing. #6

Open
winston0410 opened this issue Jun 6, 2020 · 0 comments
Open

builder.js not firing. #6

winston0410 opened this issue Jun 6, 2020 · 0 comments

Comments

@winston0410
Copy link

I found out that builder.js is not firing, thus I cannot get the service-worker.js. I have made some changes to .eleventy.js, in order to make it works again and easier to read.

const shimmer = require("shimmer");
const swBuild = require("./src/builder.js");

module.exports = {
  configFunction: (__, options = {}) => {
    console.log('PWA running');
    function postBuild() {
      const Eleventy = require("@11ty/eleventy/src/Eleventy");
      shimmer.wrap(Eleventy.prototype, "finish", function(orig) {
        const outputDir = new Eleventy().outputDir;
        process.on("unhandledRejection", (reason) => {
          console.log("Reason: " + reason);
        });
        return swBuild(options, outputDir).then((res) => console.log(res));

      });
    }
    setImmediate(postBuild);
  }
};

It will be great if you can update the code for the next version. Thanks.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant