From b295d2b326dae5996af72da16ea51b01f17a7f2b Mon Sep 17 00:00:00 2001 From: Nolan Lawson Date: Sun, 4 Jul 2021 16:53:31 -0700 Subject: [PATCH] fix: fix some CJS imports --- bin/build-svg.js | 4 +++- bin/build-template-html.js | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/bin/build-svg.js b/bin/build-svg.js index bbc3787a..18c83a4a 100755 --- a/bin/build-svg.js +++ b/bin/build-svg.js @@ -3,7 +3,9 @@ import path from 'path' import fs from 'fs' import { promisify } from 'util' import { optimize } from 'svgo' -import $ from 'cheerio' +import cheerioPackage from 'cheerio' + +const { default: $ } = cheerioPackage const __dirname = path.dirname(new URL(import.meta.url).pathname) const readFile = promisify(fs.readFile) diff --git a/bin/build-template-html.js b/bin/build-template-html.js index eaa794c0..46e089a3 100644 --- a/bin/build-template-html.js +++ b/bin/build-template-html.js @@ -9,7 +9,9 @@ import { performance } from 'perf_hooks' import { debounce } from '../src/routes/_thirdparty/lodash/timers.js' import applyIntl from '../webpack/svelte-intl-loader.js' import { LOCALE } from '../src/routes/_static/intl.js' -import { getLangDir } from 'rtl-detect' +import rtlDetectPackage from 'rtl-detect' + +const { getLangDir } = rtlDetectPackage const __dirname = path.dirname(new URL(import.meta.url).pathname) const writeFile = promisify(fs.writeFile)