@surma/rollup-plugin-off-main-thread
Advanced tools
Comparing version 1.4.1 to 1.4.2
12
index.js
@@ -37,3 +37,5 @@ /** | ||
// The scheme used when importing workers as a URL. | ||
urlLoaderScheme: "omt" | ||
urlLoaderScheme: "omt", | ||
// Silence the warning about ESM being badly supported in workers. | ||
silenceESMWorkerWarning: false, | ||
}; | ||
@@ -58,3 +60,3 @@ | ||
outputOptions({ format }) { | ||
if (format === "esm" || format === "es") { | ||
if ((format === "esm" || format === "es") && !opts.silenceESMWorkerWarning) { | ||
this.warn( | ||
@@ -76,6 +78,6 @@ 'Very few browsers support ES modules in Workers. If you want to your code to run in all browsers, set `output.format = "amd";`' | ||
const path = id.slice(urlLoaderPrefix.length); | ||
const newId = (await this.resolve(path, importer)).id; | ||
const resolved = await this.resolve(path, importer); | ||
if (!resolved) throw Error(`Cannot find module '${path}' from '${importer}'`); | ||
const newId = resolved.id; | ||
if (!newId) throw Error(`Cannot find module '${path}'`); | ||
return urlLoaderPrefix + newId; | ||
@@ -82,0 +84,0 @@ }, |
{ | ||
"name": "@surma/rollup-plugin-off-main-thread", | ||
"version": "1.4.1", | ||
"version": "1.4.2", | ||
"description": "Use Rollup with workers and ES6 modules today.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
77792
1267