diff --git a/rollup.config.js b/rollup.config.js index 3b2e9ef..b3d5c51 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -4,21 +4,6 @@ import typescript from "rollup-plugin-ts"; import { preserveShebangs } from "rollup-plugin-preserve-shebangs"; import { terser } from "rollup-plugin-terser"; -function retainImports() { - return { - name: "retain-import-expression", - resolveDynamicImport() { - return false; - }, - renderDynamicImport() { - return { - left: "import(", - right: ")", - }; - }, - }; -} - export default [ { input: "src/utils/index.ts", @@ -42,7 +27,6 @@ export default [ resolve(), typescript({ outDir: "." }), commonjs(), - retainImports(), preserveShebangs(), ], }, diff --git a/src/utils/shimmie.ts b/src/utils/shimmie.ts index 148e920..4478c0c 100644 --- a/src/utils/shimmie.ts +++ b/src/utils/shimmie.ts @@ -1,4 +1,6 @@ -import type { CSSVarsPonyfillOptions } from "css-vars-ponyfill"; +import cssVarsPonyfill, { + type CSSVarsPonyfillOptions, +} from "css-vars-ponyfill"; /** * Conditionally load and apply a shim for CSS variables in IE */ @@ -11,16 +13,14 @@ export function shimmie({ if (!test) { document.body.style.visibility = "hidden"; - import("css-vars-ponyfill").then(({ default: cssVarsPonyfill }) => { - cssVarsPonyfill({ - watch: true, - updateURLs: false, - onComplete() { - onComplete?.(); - document.body.style.visibility = "visible"; - }, - ...config, - }); + cssVarsPonyfill({ + watch: true, + updateURLs: false, + onComplete() { + onComplete?.(); + document.body.style.visibility = "visible"; + }, + ...config, }); } }