diff --git a/src/apply-style.ts b/src/apply-style.ts index 5c58728d..c36a04e5 100644 --- a/src/apply-style.ts +++ b/src/apply-style.ts @@ -1,4 +1,4 @@ -import type { Options } from './types' +import type { Options } from './types.js' export function applyStyle( node: T, diff --git a/src/clone-node.ts b/src/clone-node.ts index 5dfcd117..90ad0b6c 100644 --- a/src/clone-node.ts +++ b/src/clone-node.ts @@ -1,13 +1,13 @@ -import type { Options } from './types' -import { clonePseudoElements } from './clone-pseudos' +import type { Options } from './types.js' +import { clonePseudoElements } from './clone-pseudos.js' import { createImage, toArray, isInstanceOfElement, getStyleProperties, -} from './util' -import { getMimeType } from './mimes' -import { resourceToDataURL } from './dataurl' +} from './util.js' +import { getMimeType } from './mimes.js' +import { resourceToDataURL } from './dataurl.js' async function cloneCanvasElement(canvas: HTMLCanvasElement) { const dataURL = canvas.toDataURL() diff --git a/src/clone-pseudos.ts b/src/clone-pseudos.ts index b5af1edc..9f644aa6 100644 --- a/src/clone-pseudos.ts +++ b/src/clone-pseudos.ts @@ -1,5 +1,5 @@ -import type { Options } from './types' -import { uuid, getStyleProperties } from './util' +import type { Options } from './types.js' +import { uuid, getStyleProperties } from './util.js' type Pseudo = ':before' | ':after' diff --git a/src/dataurl.ts b/src/dataurl.ts index 13bc8b43..0b8c169c 100644 --- a/src/dataurl.ts +++ b/src/dataurl.ts @@ -1,4 +1,4 @@ -import { Options } from './types' +import { Options } from './types.js' function getContentFromDataUrl(dataURL: string) { return dataURL.split(/,/)[1] diff --git a/src/embed-images.ts b/src/embed-images.ts index 0d7b51ad..622295b7 100644 --- a/src/embed-images.ts +++ b/src/embed-images.ts @@ -1,8 +1,8 @@ -import { Options } from './types' -import { embedResources } from './embed-resources' -import { toArray, isInstanceOfElement } from './util' -import { isDataUrl, resourceToDataURL } from './dataurl' -import { getMimeType } from './mimes' +import { Options } from './types.js' +import { embedResources } from './embed-resources.js' +import { toArray, isInstanceOfElement } from './util.js' +import { isDataUrl, resourceToDataURL } from './dataurl.js' +import { getMimeType } from './mimes.js' async function embedProp( propName: string, diff --git a/src/embed-resources.ts b/src/embed-resources.ts index bed8b373..43dfda6c 100644 --- a/src/embed-resources.ts +++ b/src/embed-resources.ts @@ -1,7 +1,7 @@ -import { Options } from './types' -import { resolveUrl } from './util' -import { getMimeType } from './mimes' -import { isDataUrl, makeDataUrl, resourceToDataURL } from './dataurl' +import { Options } from './types.js' +import { resolveUrl } from './util.js' +import { getMimeType } from './mimes.js' +import { isDataUrl, makeDataUrl, resourceToDataURL } from './dataurl.js' const URL_REGEX = /url\((['"]?)([^'"]+?)\1\)/g const URL_WITH_FORMAT_REGEX = /url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g diff --git a/src/embed-webfonts.ts b/src/embed-webfonts.ts index a84a699d..f5e1b1f8 100644 --- a/src/embed-webfonts.ts +++ b/src/embed-webfonts.ts @@ -1,7 +1,7 @@ -import type { Options } from './types' -import { toArray } from './util' -import { fetchAsDataURL } from './dataurl' -import { shouldEmbed, embedResources } from './embed-resources' +import type { Options } from './types.js' +import { toArray } from './util.js' +import { fetchAsDataURL } from './dataurl.js' +import { shouldEmbed, embedResources } from './embed-resources.js' interface Metadata { url: string diff --git a/src/index.ts b/src/index.ts index 2de59a30..8d265179 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,8 +1,8 @@ -import { Options } from './types' -import { cloneNode } from './clone-node' -import { embedImages } from './embed-images' -import { applyStyle } from './apply-style' -import { embedWebFonts, getWebFontCSS } from './embed-webfonts' +import { Options } from './types.js' +import { cloneNode } from './clone-node.js' +import { embedImages } from './embed-images.js' +import { applyStyle } from './apply-style.js' +import { embedWebFonts, getWebFontCSS } from './embed-webfonts.js' import { getImageSize, getPixelRatio, @@ -10,7 +10,7 @@ import { canvasToBlob, nodeToDataURL, checkCanvasDimensions, -} from './util' +} from './util.js' export async function toSvg( node: T, diff --git a/src/util.ts b/src/util.ts index 3d430c8f..38ac2986 100644 --- a/src/util.ts +++ b/src/util.ts @@ -1,4 +1,4 @@ -import type { Options } from './types' +import type { Options } from './types.js' export function resolveUrl(url: string, baseUrl: string | null): string { // url is absolute already