From 612511d88018ae2983f69155f6a7d9c89bf514ff Mon Sep 17 00:00:00 2001 From: Tyler Hallada Date: Sun, 27 May 2018 11:40:01 -0400 Subject: [PATCH] docs: use ES6 import in TypeScript README example (#140) Updates the TypeScript example to use the ES6 import syntax like the other examples. Includes the change to `Worker.ts` mentioned in https://github.com/webpack-contrib/worker-loader/issues/111 to get it to work with `import` instead of `require`. --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index c4e70ba..9b8b950 100644 --- a/README.md +++ b/README.md @@ -174,7 +174,7 @@ declare module "worker-loader!*" { constructor(); } - export = WebpackWorker; + export default WebpackWorker; } ``` @@ -191,7 +191,7 @@ ctx.addEventListener("message", (event) => console.log(event)); **App.ts** ```typescript -import Worker = require("worker-loader!./Worker"); +import Worker from "worker-loader!./Worker"; const worker = new Worker();