diff --git a/.nvmrc b/.nvmrc index dec2bf5..2edeafb 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -19 \ No newline at end of file +20 \ No newline at end of file diff --git a/packages/core/import_map.json b/packages/core/import_map.json index a025375..5e141cf 100644 --- a/packages/core/import_map.json +++ b/packages/core/import_map.json @@ -1,11 +1,11 @@ { "imports": { "@okikio/emitter": "npm:@okikio/emitter", - "esbuild-wasm/package.json": "https://unpkg.com/esbuild-wasm@0.18.11/package.json", - "esbuild-wasm/esm/browser.d.ts": "https://unpkg.com/esbuild-wasm@0.18.11/esm/browser.d.ts", + "esbuild-wasm/package.json": "https://unpkg.com/esbuild-wasm/package.json", + "esbuild-wasm/esm/browser.d.ts": "https://unpkg.com/esbuild-wasm/esm/browser.d.ts", - "esbuild-wasm": "https://esm.sh/esbuild-wasm@0.18.11", - "esbuild": "https://deno.land/x/esbuild@v0.18.11/mod.js", + "esbuild-wasm": "https://esm.sh/esbuild-wasm", + "esbuild": "https://deno.land/x/esbuild/mod.js", "resolve.exports": "https://esm.sh/resolve.exports", "velo": "https://deno.land/x/velo@1.0.0/mod.ts" diff --git a/packages/core/src/plugins/alias.ts b/packages/core/src/plugins/alias.ts index 40aa948..b6dcb81 100644 --- a/packages/core/src/plugins/alias.ts +++ b/packages/core/src/plugins/alias.ts @@ -8,6 +8,7 @@ import { parsePackageName } from "../utils/parse-package-name.ts"; import { getCDNUrl, DEFAULT_CDN_HOST } from "../utils/util-cdn.ts"; import { isBareImport } from "../utils/path.ts"; +import { PackageJson } from "./cdn.ts"; /** Alias Plugin Namespace */ export const ALIAS_NAMESPACE = "alias-globals"; @@ -37,7 +38,7 @@ export const isAlias = (id: string, aliases = {}) => { * @param host The default host origin to use if an import doesn't already have one * @param logger Console log */ -export const ALIAS_RESOLVE = (aliases = {}, host = DEFAULT_CDN_HOST, FAILED_EXTENSION_CHECKS?: Set) => { +export const ALIAS_RESOLVE = (aliases = {}, host = DEFAULT_CDN_HOST, rootPkg: Partial = {}, FAILED_EXTENSION_CHECKS?: Set) => { return async (args: ESBUILD.OnResolveArgs): Promise => { const path = args.path.replace(/^node\:/, ""); const { path: argPath } = getCDNUrl(path); @@ -45,7 +46,7 @@ export const ALIAS_RESOLVE = (aliases = {}, host = DEFAULT_CDN_HOST, FAILED_EXTE if (isAlias(argPath, aliases)) { const pkgDetails = parsePackageName(argPath); const aliasPath = aliases[pkgDetails.name]; - return HTTP_RESOLVE(host)({ + return HTTP_RESOLVE(host, rootPkg)({ ...args, path: aliasPath }); @@ -63,6 +64,7 @@ export const ALIAS_RESOLVE = (aliases = {}, host = DEFAULT_CDN_HOST, FAILED_EXTE export const ALIAS = (state: StateArray, config: BuildConfig): ESBUILD.Plugin => { // Convert CDN values to URL origins const { origin: host } = !/:/.test(config?.cdn) ? getCDNUrl(config?.cdn + ":") : getCDNUrl(config?.cdn); + const pkgJSON = config["package.json"]; const aliases = config.alias ?? {}; const [get] = state; @@ -76,7 +78,7 @@ export const ALIAS = (state: StateArray, config: BuildConfig): ESBUI // this plugin. build.onResolve({ filter: /^node\:.*/ }, (args) => { if (isAlias(args.path, aliases)) - return ALIAS_RESOLVE(aliases, host)(args); + return ALIAS_RESOLVE(aliases, host, pkgJSON)(args); if (!config.polyfill) { return { @@ -92,8 +94,8 @@ export const ALIAS = (state: StateArray, config: BuildConfig): ESBUI // files will be in the "http-url" namespace. Make sure to keep // the newly resolved URL in the "http-url" namespace so imports // inside it will also be resolved as URLs recursively. - build.onResolve({ filter: /.*/ }, ALIAS_RESOLVE(aliases, host, FAILED_EXTENSION_CHECKS)); - build.onResolve({ filter: /.*/, namespace: ALIAS_NAMESPACE }, ALIAS_RESOLVE(aliases, host, FAILED_EXTENSION_CHECKS)); + build.onResolve({ filter: /.*/ }, ALIAS_RESOLVE(aliases, host, pkgJSON, FAILED_EXTENSION_CHECKS)); + build.onResolve({ filter: /.*/, namespace: ALIAS_NAMESPACE }, ALIAS_RESOLVE(aliases, host, pkgJSON, FAILED_EXTENSION_CHECKS)); }, }; }; \ No newline at end of file diff --git a/packages/core/src/plugins/cdn.ts b/packages/core/src/plugins/cdn.ts index 298ca0e..9bd7608 100644 --- a/packages/core/src/plugins/cdn.ts +++ b/packages/core/src/plugins/cdn.ts @@ -12,6 +12,7 @@ import { extname, isBareImport } from "../utils/path.ts"; import { getRequest } from "../utils/fetch-and-cache.ts"; import { getCDNUrl, getCDNStyle, DEFAULT_CDN_HOST } from "../utils/util-cdn.ts"; +import { deepAssign } from "../util.ts"; /** CDN Plugin Namespace */ export const CDN_NAMESPACE = "cdn-url"; @@ -98,7 +99,13 @@ export const CDN_RESOLVE = (cdn = DEFAULT_CDN_HOST, rootPkg: Partial, config: BuildConfig): ES // Convert CDN values to URL origins const { origin: host } = config?.cdn && !/:/.test(config?.cdn) ? getCDNUrl(config?.cdn + ":") : getCDNUrl(config?.cdn ?? DEFAULT_CDN_HOST); const { external = [] } = config?.esbuild ?? {}; + const pkgJSON = config["package.json"]; const [get] = state; return { @@ -110,7 +111,7 @@ export function EXTERNAL(state: StateArray, config: BuildConfig): ES if (config.polyfill && isAlias(argPath, PolyfillMap) && !external.includes(argPath)) { const pkgDetails = parsePackageName(argPath); const aliasPath = PolyfillMap[pkgDetails.name as keyof typeof PolyfillMap]; - return CDN_RESOLVE(host)({ + return CDN_RESOLVE(host, pkgJSON)({ ...args, path: aliasPath }); diff --git a/packages/core/src/plugins/http.ts b/packages/core/src/plugins/http.ts index 7f8ab33..e1734d9 100644 --- a/packages/core/src/plugins/http.ts +++ b/packages/core/src/plugins/http.ts @@ -5,7 +5,7 @@ import type { ESBUILD } from "../types.ts"; import { dispatchEvent, LOGGER_ERROR, LOGGER_INFO, LOGGER_WARN } from "../configs/events.ts"; -import { CDN_RESOLVE } from "./cdn.ts"; +import { CDN_RESOLVE, PackageJson } from "./cdn.ts"; import { getRequest } from "../utils/fetch-and-cache.ts"; import { decode } from "../utils/encode-decode.ts"; import { parsePackageName } from "../utils/parse-package-name.ts"; @@ -146,7 +146,7 @@ export async function determineExtension(path: string, headersOnly: true | false * @param host The default host origin to use if an import doesn't already have one * @param logger Console log */ -export function HTTP_RESOLVE(host = DEFAULT_CDN_HOST) { +export function HTTP_RESOLVE(host = DEFAULT_CDN_HOST, rootPkg: Partial = {}) { return async (args: ESBUILD.OnResolveArgs): Promise => { // Some packages use "../../" with the assumption that "/" is equal to "/index.js", this is supposed to fix that bug const argPath = args.path; //.replace(/\/$/, "/index"); @@ -174,7 +174,7 @@ export function HTTP_RESOLVE(host = DEFAULT_CDN_HOST) { // If the import is a bare import, use the CDN plugins resolution algorithm if (isBareImport(argPath)) { - return await CDN_RESOLVE(origin)(args); + return await CDN_RESOLVE(origin, rootPkg)(args); } else { /** * If the import is neither an http import or a bare import (module import), then it is an absolute import. @@ -220,6 +220,7 @@ export function HTTP_RESOLVE(host = DEFAULT_CDN_HOST) { export function HTTP (state: StateArray, config: BuildConfig): ESBUILD.Plugin { // Convert CDN values to URL origins const { origin: host } = config?.cdn && !/:/.test(config?.cdn) ? getCDNUrl(config?.cdn + ":") : getCDNUrl(config?.cdn ?? DEFAULT_CDN_HOST); + const pkgJSON = config["package.json"]; const [get, set] = state; const assets = get()["assets"] ?? []; @@ -244,7 +245,7 @@ export function HTTP (state: StateArray, config: BuildConfig): ESBUI // files will be in the "http-url" namespace. Make sure to keep // the newly resolved URL in the "http-url" namespace so imports // inside it will also be resolved as URLs recursively. - build.onResolve({ filter: /.*/, namespace: HTTP_NAMESPACE }, HTTP_RESOLVE(host)); + build.onResolve({ filter: /.*/, namespace: HTTP_NAMESPACE }, HTTP_RESOLVE(host, pkgJSON)); // When a URL is loaded, we want to actually download the content // from the internet. This has just enough logic to be able to diff --git a/packages/edge/generate-result.ts b/packages/edge/generate-result.ts index c23ca84..e1dacaa 100644 --- a/packages/edge/generate-result.ts +++ b/packages/edge/generate-result.ts @@ -293,6 +293,7 @@ export async function generateResult([badgeKey, badgeID]: string[], [value, resu }); } + // console.log("Respond with JSON Response", value) const { metafile: _metafile, warnings: _warnings, ...usefulInfo } = value; const addDocs = (url.search === "" ? docs : ""); const finalResult = Object.assign({}, usefulInfo, addDocs, diff --git a/packages/edge/import_map.json b/packages/edge/import_map.json index 6857e3c..11fe8ae 100644 --- a/packages/edge/import_map.json +++ b/packages/edge/import_map.json @@ -3,9 +3,9 @@ "@bundlejs/core/": "../core/", "@bundlejs/core": "../core/src/index.ts", - "esbuild-wasm/esm/browser.d.ts": "https://unpkg.com/esbuild-wasm@0.18.11/esm/browser.d.ts", - "esbuild-wasm": "https://esm.sh/esbuild-wasm@0.18.11", - "esbuild": "https://deno.land/x/esbuild@v0.18.11/wasm.js", + "esbuild-wasm/esm/browser.d.ts": "https://unpkg.com/esbuild-wasm/esm/browser.d.ts", + "esbuild-wasm": "https://esm.sh/esbuild-wasm", + "esbuild": "https://deno.land/x/esbuild/wasm.js", "resolve.exports": "https://esm.sh/resolve.exports", @@ -16,8 +16,8 @@ "velo": "https://deno.land/x/velo@1.0.0/mod.ts", "base64": "https://deno.land/x/base64@v0.2.1/mod.ts", - "upstash_redis": "https://deno.land/x/upstash_redis@v1.22.0/mod.ts", - "http": "https://deno.land/std@0.193.0/http/server.ts", - "path": "https://deno.land/std@0.193.0/path/mod.ts" + "upstash_redis": "https://deno.land/x/upstash_redis/mod.ts", + "http": "https://deno.land/std/http/server.ts", + "path": "https://deno.land/std/path/mod.ts" } } \ No newline at end of file diff --git a/packages/edge/mod.ts b/packages/edge/mod.ts index c35d191..84bdc3f 100644 --- a/packages/edge/mod.ts +++ b/packages/edge/mod.ts @@ -1,6 +1,8 @@ -import type { BuildConfig, CompressConfig } from "@bundlejs/core"; +import type { BuildConfig, CompressConfig, PackageJson } from "@bundlejs/core"; import type { BundleResult } from "./bundle.ts"; +import JSON5 from "./vendor/json5.ts"; + import { Redis } from "upstash_redis"; import { serve } from "http"; import { dirname, fromFileUrl, join, extname, basename } from "path"; @@ -160,6 +162,8 @@ serve(async (req: Request) => { const initialValue = parseShareURLQuery(url) || inputModelResetValue; const { init: _, entryPoints: _2, ansi: _3, ...initialConfig } = (parseConfig(url) || {}) as Config; + const configQuery = url.searchParams.get("config"); + const treeshakeQuery = url.searchParams.has("treeshake"); const treeshake = url.searchParams.get("treeshake"); const treeshakeArr = parseTreeshakeExports( @@ -180,6 +184,7 @@ serve(async (req: Request) => { const badgeQuery = url.searchParams.has("badge") || ["/badge", "/badge/raster", "/badge-raster"].includes(url.pathname); const polyfill = url.searchParams.has("polyfill"); + const prettyQuery = url.searchParams.has("pretty"); const minifyQuery = url.searchParams.has("minify"); const sourcemapQuery = url.searchParams.has("sourcemap"); @@ -191,11 +196,13 @@ serve(async (req: Request) => { metafileQuery || Boolean(initialConfig?.analysis); + const prettyResult = url.searchParams.get("pretty"); const minifyResult = url.searchParams.get("minify"); const minify = initialConfig?.esbuild?.minify ?? ( minifyQuery ? (minifyResult?.length === 0 ? true : convertQueryValue(minifyResult)) - : initialConfig?.esbuild?.minify + : (prettyQuery ? (prettyResult?.length === 0 ? !prettyQuery : !convertQueryValue(prettyResult)) : null) ?? + initialConfig?.esbuild?.minify ); const sourcemapResult = url.searchParams.get("sourcemap"); @@ -207,7 +214,7 @@ serve(async (req: Request) => { const formatQuery = url.searchParams.has("format"); const format = initialConfig?.esbuild?.format || url.searchParams.get("format"); - + const configObj: Config = deepAssign( {}, BUILD_CONFIG, @@ -221,7 +228,7 @@ serve(async (req: Request) => { esbuild: deepAssign( {}, enableMetafile ? { metafile: enableMetafile } : {}, - minifyQuery ? { minify } : {}, + minifyQuery || prettyQuery ? { minify } : {}, sourcemapQuery ? { sourcemap } : {}, formatQuery ? { format } : {}, ), @@ -246,6 +253,13 @@ serve(async (req: Request) => { url.searchParams.get("query") ) ?? "spring-easing" ); + // All the queries that will affect the final result + const mutationQueries = + shareQuery || textQuery || minifyQuery || prettyQuery || polyfill || tsxQuery || + formatQuery || configQuery || badgeQuery || sourcemapQuery || analysisQuery || metafileQuery; + const rootPkg = configObj["package.json"] ?? {} as PackageJson; + const dependecies = Object.assign({}, rootPkg.devDependencies, rootPkg.peerDependencies, rootPkg.dependencies) + console.log({ dependecies }) const versionsList = await Promise.allSettled( !hasQuery && (shareQuery || textQuery) ? [] : query @@ -258,7 +272,7 @@ serve(async (req: Request) => { .map(async (x) => { const [pkgName, imported] = x; const { name = pkgName, version, path } = parsePackageName(pkgName, true) - return [name, await resolveVersion(pkgName) ?? version, path, imported] + return [name, await resolveVersion(dependecies[name] ? `${name}@${dependecies[name]}` : pkgName) ?? version, path, imported] }) ); @@ -286,7 +300,7 @@ serve(async (req: Request) => { versions, initialValue: initialValue.trim(), }); - const jsonKey = `json/${JSON.stringify(jsonKeyObj).trim()}`; + const jsonKey = `json/${JSON5.stringify(jsonKeyObj).trim()}`; const badgeResult = url.searchParams.get("badge"); const badgeStyle = url.searchParams.get("badge-style"); @@ -304,7 +318,7 @@ serve(async (req: Request) => { style: badgeStyle } }); - const badgeID = JSON.stringify(badgeIDObj).trim(); + const badgeID = JSON5.stringify(badgeIDObj).trim(); try { if (!redis) throw new Error("Redis not available"); @@ -318,10 +332,12 @@ serve(async (req: Request) => { try { console.log(`Deleting ${badgeKey}\n`) - const JSONResult = await redis.get(jsonKey); + const JSONResultString = await redis.get(jsonKey); + const JSONResult = JSONResultString ? JSON5.parse(JSONResultString) : null; const [moduleName] = modules[0]; - const PackageResult = await redis.get(getPackageResultKey(moduleName)); + const PackageResultString = await redis.get(getPackageResultKey(moduleName)); + const PackageResult = PackageResultString ? JSON5.parse(PackageResultString) : null; await redis.del(jsonKey, badgeKey, getPackageResultKey(moduleName)); console.log(`Deleting "${getPackageResultKey(moduleName)}" and ${jsonKey}\n`) @@ -359,7 +375,8 @@ serve(async (req: Request) => { if (url.pathname !== "/no-cache") { const BADGEResult = await redis.hget(badgeKey, badgeID); - const JSONResult = await redis.get(jsonKey); + const JSONStringValue = await redis.get(jsonKey); + const JSONResult = JSONStringValue ? JSON5.parse(JSONStringValue) : null; if (badgeQuery && BADGEResult && JSONResult) { dispatchEvent(LOGGER_INFO, { badgeResult, badgeQuery, badgeStyle, badgeRasterQuery }) @@ -371,6 +388,7 @@ serve(async (req: Request) => { badge: badgeQuery, }, url.href) + console.log("Respond with Cached Badge") return new Response(badgeRasterQuery ? toUint8Array(BADGEResult) : BADGEResult, { status: 200, headers: [ @@ -392,11 +410,16 @@ serve(async (req: Request) => { type: "generate-from-cache-json", jsonKeyObj }, url.href) + + console.log("Respond with Cached JSON Response", { + jsonKeyObj, + }) return await generateResult([badgeKey, badgeID], [JSONResult, undefined], url, true, Date.now() - start, redis); - } else if (modules.length === 1 && exportAll && !(shareQuery || textQuery)) { + } else if (modules.length === 1 && exportAll && !mutationQueries) { const [moduleName, mode] = modules[0]; if (mode === "export") { - const PackageResult = await redis.get(getPackageResultKey(moduleName)); + const PackageResultString = await redis.get(getPackageResultKey(moduleName)); + const PackageResult = PackageResultString ? JSON5.parse(PackageResultString) : null; const fileQuery = fileCheck ? PackageResult?.fileId : true; if (PackageResult && fileQuery) { trackEvent("generate-from-package-cache-json", { @@ -404,11 +427,8 @@ serve(async (req: Request) => { packageResultKey: getPackageResultKey(moduleName), jsonKeyObj }, url.href) - console.log({ - type: "generate-from-package-cache-json", - packageResultKey: getPackageResultKey(moduleName), - jsonKeyObj - }) + + console.log("Respond with Module Response from Permanent Cache", getPackageResultKey(moduleName)) return await generateResult([badgeKey, badgeID], [PackageResult, undefined], url, true, Date.now() - start, redis); } } @@ -453,20 +473,20 @@ serve(async (req: Request) => { try { if (!redis) throw new Error("Redis not available"); - const prevValue = await redis.get(jsonKey); - await redis.set(jsonKey, JSON.stringify(value), { ex: 86400 }); + const prevValueString = await redis.get(jsonKey) + await redis.set(jsonKey, JSON5.stringify(value), { ex: 86400 }); if (modules.length === 1 && exportAll && !(shareQuery || textQuery)) { const [moduleName, mode] = modules[0]; if (mode === "export") { - await redis.set(getPackageResultKey(moduleName), JSON.stringify(value)); + await redis.set(getPackageResultKey(moduleName), JSON5.stringify(value)); } } await redis.del(badgeKey); - if (prevValue) { - const jsonPrevValue: BundleResult = typeof prevValue === "object" ? prevValue : JSON.parse(prevValue); - if (typeof jsonPrevValue === "object" && jsonPrevValue.fileId) { + if (prevValueString) { + const jsonPrevValue = prevValueString ? JSON5.parse(prevValueString) : null; + if (jsonPrevValue && typeof jsonPrevValue === "object" && jsonPrevValue.fileId) { await deleteGist(jsonPrevValue.fileId) } } @@ -474,6 +494,7 @@ serve(async (req: Request) => { console.warn(e) } + console.log("Respond with New Bundle Result") return await generateResult([badgeKey, badgeID], [value, resultText], url, false, Date.now() - start, redis); } catch (e) { trackEvent("full-error", { diff --git a/packages/edge/parse-query.ts b/packages/edge/parse-query.ts index 39a694d..7169a77 100644 --- a/packages/edge/parse-query.ts +++ b/packages/edge/parse-query.ts @@ -1,5 +1,6 @@ import { deepAssign, lzstring, parsePackageName } from "@bundlejs/core"; import { basename, extname } from "@bundlejs/core/src/utils/path.ts"; +import JSON5 from "./vendor/json5.ts"; const { decompressFromURL } = lzstring; @@ -101,13 +102,13 @@ export const parseShareURLQuery = (shareURL: URL) => { const count = (counts.set(module, counts.get(module)! + 1).get(module)! - 1); const countStr = count <= 0 ? "" : count; - return `${declaration} ${treeshakeExports} from ${JSON.stringify( + return `${declaration} ${treeshakeExports} from ${JSON5.stringify( module )};${ (treeshake ?? "").trim().length <= 0 ? `\n${declaration} { default ${ declaration === "import" || queryArrLen > 1 ? `as ${getModuleName(module) + "Default" + countStr} ` : "" - }} from ${JSON.stringify(module)};` : `` + }} from ${JSON5.stringify(module)};` : `` }`; }) .join("\n") @@ -119,7 +120,7 @@ export const parseShareURLQuery = (shareURL: URL) => { const plaintext = searchParams.get("text"); if (plaintext) { - result += "\n" + JSON.parse( + result += "\n" + JSON5.parse( /** * Support users wrapping/not-wrapping plaintext in a string, * e.g. @@ -137,7 +138,7 @@ export const parseShareURLQuery = (shareURL: URL) => { * console.log(window) * ``` */ - /^["']/.test(plaintext) && /["']$/.test(plaintext) ? plaintext : JSON.stringify("" + plaintext).replace(/\\\\/g, "\\") + /^["']/.test(plaintext) && /["']$/.test(plaintext) ? plaintext : JSON5.stringify("" + plaintext).replace(/\\\\/g, "\\") ); } @@ -156,7 +157,7 @@ export const parseConfig = (shareURL: URL) => { try { const searchParams = shareURL.searchParams; const config = searchParams.get("config") ?? "{}"; - return deepAssign({}, JSON.parse(config ? config : "{}")); + return deepAssign({}, JSON5.parse(config ? config : "{}")); } catch (e) { console.warn(e); } diff --git a/packages/edge/vendor/json5.ts b/packages/edge/vendor/json5.ts new file mode 100644 index 0000000..af845e8 --- /dev/null +++ b/packages/edge/vendor/json5.ts @@ -0,0 +1,54 @@ +/** + * Based on https://deno.land/x/json5@v1.0.0/mod.ts + */ +import JSON5_MOD from "https://esm.sh/json5"; + +/** + * Converts a JSON5 string into an object. + * @template T Type of return value. + * @param text A valid JSON string. + * @param reviver A function that transforms the results. This function is called for each member of the object. If a member contains nested objects, the nested objects are transformed before the parent object is. + */ +export function parse(text: string, reviver?: ((this: any, key: string, value: any) => any | null)): T { + return JSON5_MOD.parse(text, reviver); +} + +/** + * Converts a JavaScript value to a JSON5 string. + * @param value A JavaScript value, usually an object or array, to be converted. + * @param replacer A function that transforms the results. + * @param space Adds indentation, white space, and line break characters to the return-value JSON text to make it easier to read. + */ +export function stringify(value: any, replacer?: ((this: any, key: string, value: any) => any) | null, space?: string | number | undefined): string { + // @ts-ignore + return JSON5_MOD.stringify(value, replacer, parseInt(space) || undefined); +} + +/** + * Loads JSON5 from file synchronously + * @param path File path or url + */ +export function require(path: string | URL): any { + const data = Deno.readFileSync(path); + const decoder = new TextDecoder("utf8"); + const raw = decoder.decode(data); + + return JSON5_MOD.parse(raw, null); +} + +/** + * Loads JSON5 from file asynchronously + * @param path File path or url + */ +export async function requireAsync(path: string | URL): Promise { + const data = await Deno.readFileSync(path); + const decoder = new TextDecoder("utf8"); + const raw = decoder.decode(data); + + return JSON5_MOD.parse(raw, null); +} + +// defaults +const JSON5 = { parse, stringify, require, requireAsync }; + +export default JSON5; \ No newline at end of file diff --git a/tsconfig.json b/tsconfig.json index 1d81f3e..60df10c 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -17,6 +17,7 @@ "emitDeclarationOnly": true, "declaration": true, // Add support for Web Workers - "lib": ["ES2022", "DOM", "DOM.Iterable"] + "lib": ["ES2022", "DOM", "DOM.Iterable"], + "verbatimModuleSyntax": true } } \ No newline at end of file