Skip to content

Commit

Permalink
Remove import.meta?.url polyfill
Browse files Browse the repository at this point in the history
  • Loading branch information
linev committed Sep 30, 2024
1 parent c82b0c9 commit 4534014
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions build/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ import meta from '../package.json' assert {type: 'json'};

const ignore_modules = ['fs', 'zlib', 'gl', './base/lzma.mjs', './base/zstd.mjs', '../../scripts/jspdf.es.min.js', '../../scripts/svg2pdf.es.min.js'];

const importMetaUrlPolyfill = `(typeof document === 'undefined' && typeof location === 'undefined' ? undefined : typeof document === 'undefined' ? location.href : (document.currentScript && document.currentScript.src || new URL('jsroot.js', document.baseURI).href));`;

for(let key in meta.dependencies)
ignore_modules.push(key);

Expand All @@ -25,9 +23,6 @@ const config = {
banner: `// ${meta.homepage} v${meta.version}`
},
plugins: [
modify({
'import.meta?.url': importMetaUrlPolyfill
}),
ignore(ignore_modules),
nodeResolve(),
json(),
Expand Down Expand Up @@ -83,8 +78,7 @@ const config_geom_nothreejs = {
plugins: [
modify({
"from '../three.mjs'": "from 'three'",
"from '../three_addons.mjs'": "from 'three/addons'",
'import.meta?.url': importMetaUrlPolyfill
"from '../three_addons.mjs'": "from 'three/addons'"
}),
ignore(ignore_modules),
nodeResolve(),
Expand Down

0 comments on commit 4534014

Please sign in to comment.