mirror of
https://github.com/GoogleChromeLabs/squoosh.git
synced 2025-11-11 16:26:20 +00:00
Keep js extension while importing module & types
This commit is contained in:
@@ -25,12 +25,12 @@ interface ResizeInstantiateOptions {
|
|||||||
|
|
||||||
declare global {
|
declare global {
|
||||||
// Needed for being able to use ImageData as type in codec types
|
// Needed for being able to use ImageData as type in codec types
|
||||||
type ImageData = typeof import('./image_data');
|
type ImageData = typeof import('./image_data.js');
|
||||||
// Needed for being able to assign to `globalThis.ImageData`
|
// Needed for being able to assign to `globalThis.ImageData`
|
||||||
var ImageData: ImageData['constructor'];
|
var ImageData: ImageData['constructor'];
|
||||||
}
|
}
|
||||||
|
|
||||||
import type { QuantizerModule } from '../../codecs/imagequant/imagequant';
|
import type { QuantizerModule } from '../../codecs/imagequant/imagequant.js';
|
||||||
|
|
||||||
// MozJPEG
|
// MozJPEG
|
||||||
import mozEnc from '../../codecs/mozjpeg/enc/mozjpeg_node_enc.js';
|
import mozEnc from '../../codecs/mozjpeg/enc/mozjpeg_node_enc.js';
|
||||||
@@ -94,7 +94,7 @@ const imageQuantPromise: Promise<QuantizerModule> = instantiateEmscriptenWasm(
|
|||||||
);
|
);
|
||||||
|
|
||||||
// Our decoders currently rely on a `ImageData` global.
|
// Our decoders currently rely on a `ImageData` global.
|
||||||
import ImageData from './image_data';
|
import ImageData from './image_data.js';
|
||||||
globalThis.ImageData = ImageData;
|
globalThis.ImageData = ImageData;
|
||||||
|
|
||||||
function resizeNameToIndex(name: string) {
|
function resizeNameToIndex(name: string) {
|
||||||
|
|||||||
Reference in New Issue
Block a user