From c3e51a05af975d496f0f60e9275ca6c61e198ab4 Mon Sep 17 00:00:00 2001 From: Jon Ege Ronnenberg Date: Wed, 18 Jul 2018 13:15:37 +0200 Subject: [PATCH] Updated Webworker example to work with nuxt.js 2.0 (#3531) In response to @husayt's [comment](https://github.com/nuxt/nuxt.js/pull/3480#issuecomment-404150387). HMR now works. --- examples/web-worker/nuxt.config.js | 3 +++ examples/web-worker/package.json | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/examples/web-worker/nuxt.config.js b/examples/web-worker/nuxt.config.js index a05beaa98f..0326a79cf1 100644 --- a/examples/web-worker/nuxt.config.js +++ b/examples/web-worker/nuxt.config.js @@ -37,6 +37,9 @@ module.exports = { }) } + // @see https://github.com/nuxt/nuxt.js/pull/3480#issuecomment-404150387 + config.output.globalObject = "this" + if (isClient) { // web workers are only available client-side config.module.rules.push({ test: /\.worker\.js$/, // this will pick up all .js files that ends with ".worker.js" diff --git a/examples/web-worker/package.json b/examples/web-worker/package.json index f0eb63bd5c..42f8aebeeb 100644 --- a/examples/web-worker/package.json +++ b/examples/web-worker/package.json @@ -11,10 +11,13 @@ "precommit": "npm run lint" }, "dependencies": { - "nuxt": "^1.4.1" + "nuxt-edge": "^2.0.0-25523369.7c85202" }, "devDependencies": { + "babel-eslint": "^8.2.6", + "eslint": "^5.1.0", "eslint-loader": "^2.0.0", + "eslint-plugin-vue": "^4.5.0", "worker-loader": "^1.1.1" } }