diff --git a/packages/wmr/src/lib/plugins.js b/packages/wmr/src/lib/plugins.js index fbc002c2..c928fa0e 100644 --- a/packages/wmr/src/lib/plugins.js +++ b/packages/wmr/src/lib/plugins.js @@ -91,7 +91,6 @@ export function getPlugins(options) { }), // Nested workers are not supported at the moment !isWorker && workerPlugin(options), - //!isWorker && workerPlugin(options), htmPlugin({ production, sourcemap: options.sourcemap }), !isWorker && wmrPlugin({ hot: !production, sourcemap: options.sourcemap }), fastCjsPlugin({ diff --git a/packages/wmr/src/lib/rollup-plugin-container.js b/packages/wmr/src/lib/rollup-plugin-container.js index 6092ee60..cc3b7c71 100644 --- a/packages/wmr/src/lib/rollup-plugin-container.js +++ b/packages/wmr/src/lib/rollup-plugin-container.js @@ -246,10 +246,10 @@ export function createPluginContainer(plugins, opts = {}) { }, /** @param {string} property */ - resolveImportMeta(property, id) { + resolveImportMeta(property) { for (plugin of plugins) { if (!plugin.resolveImportMeta) continue; - const result = plugin.resolveImportMeta.call(ctx, property, { moduleId: id }); + const result = plugin.resolveImportMeta.call(ctx, property); if (result) return result; } diff --git a/packages/wmr/src/plugins/worker-plugin.js b/packages/wmr/src/plugins/worker-plugin.js index 7cadb413..5222c1e9 100644 --- a/packages/wmr/src/plugins/worker-plugin.js +++ b/packages/wmr/src/plugins/worker-plugin.js @@ -126,8 +126,7 @@ export function workerPlugin(options) { code: s.toString(), map: options.sourcemap ? s.generateMap({ source: id, file: path.posix.basename(id), includeContent: true }) - : null, - meta: { worker: { moduleWorkers: ['foo'] } } + : null }; } } diff --git a/packages/wmr/src/wmr-middleware.js b/packages/wmr/src/wmr-middleware.js index f47e423d..870a09f6 100644 --- a/packages/wmr/src/wmr-middleware.js +++ b/packages/wmr/src/wmr-middleware.js @@ -542,7 +542,7 @@ export const TRANSFORMS = { const rewritten = await transformImports(code, id, { resolveImportMeta(property) { - return NonRollup.resolveImportMeta(property, id); + return NonRollup.resolveImportMeta(property); }, async resolveId(spec, importer) { if (spec === 'wmr') return '/_wmr.js';