Good read, thx for the tutorial 👍

Worth to notice, for those like me who would forget it at the begin, if you try the above HelloWorld, don’t forget to export the class otherwise the object will not be found 😉

Related error:

TypeError: HelloWorld is not a constructor

Which could be solved with a module.exports :

class HelloWorld {
constructor(options) {
this.options = options;
}

apply(compiler) {
compiler.hooks.done.tap("HelloWorld", () => {
console.log(this.options.message);
});
}
}
module.exports = HelloWorld;

Written by

Freelancer by day | Creator of DeckDeckGo by night | Organizer of the Ionic and IndieHackers Zürich Meetup

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store