Closed t2ym closed 1 year ago
[rollup] import.meta.url is not properly resolved in rollup
import.meta.url
resolveImportMeta()
demo-raw/index.html
rollup-module1.js
modules/module1.js
diff --git a/demo-config/config.js b/demo-config/config.js index 7d4c7b07..4f4d4539 100644 --- a/demo-config/config.js +++ b/demo-config/config.js @@ -801,6 +801,19 @@ class TargetConfig extends Injectable(Traceable(Configurable(GulpDefaultRegistry input: path.resolve(target.entryBase, target.entry), treeshake: false, plugins: [
({ url: ${url} })
+chai.assert.isOk(import.meta.url.endsWith('modules/module1.js'), "import.meta.url.endsWith('modules/module1.js') " + import.meta.url); import("lit-html").then(dynamicModule => {
[rollup]
import.meta.url
is not properly resolved in rollupRoot Cause
resolveImportMeta()
callback is missing in rollup configufationimport.meta.url
value for the bundle file is unexpectedly providedReproducible Steps
demo-raw/index.html
, import the bundledrollup-module1.js
instead of the raw modulemodules/module1.js
Fix
resolveImportMeta()
callback({ url: ${url} })
;+chai.assert.isOk(import.meta.url.endsWith('modules/module1.js'), "import.meta.url.endsWith('modules/module1.js') " + import.meta.url); import("lit-html").then(dynamicModule => {