Browse Source

Video 10: plugins introduction.

Frederic G. MARAND 4 năm trước cách đây
mục cha
commit
fb193e4775
1 tập tin đã thay đổi với 10 bổ sung0 xóa
  1. 10 0
      ExamplePlugin.js

+ 10 - 0
ExamplePlugin.js

@@ -0,0 +1,10 @@
+class ExamplePlugin {
+  apply(compiler) {
+    compiler.plugin("run", (compiler, callback) => {
+      console.log("Webpack is running our plugin");
+      callback();
+    });
+  }
+}
+
+module.exports = ExamplePlugin;