diff --git a/package.json b/package.json index 6e80b9b..9b4c6f8 100644 --- a/package.json +++ b/package.json @@ -29,6 +29,7 @@ "postbuild": "npx esbuild src/index.ts --outfile=lib/cjs/index.js --bundle --platform=node --minify && tsc --emitDeclarationOnly --outDir lib/@types/", "watch": "tsc --watch --sourceMap --outDir lib/esm/", "squashify": "node . --in tests/images/ --out tests/output --verbose", + "squashifyDefaults": "node . -d", "test": "vitest --coverage" }, "files": [ diff --git a/src/args.ts b/src/args.ts index 9741c44..0bc5277 100644 --- a/src/args.ts +++ b/src/args.ts @@ -1,15 +1,13 @@ import { defaultConfigFile, extModes } from "./constants.js"; -import yargs from "yargs"; +import yargs, { Argv } from "yargs"; import { CliOptions, ExtMode, ResizeType, resizeType } from "./types.js"; import { hideBin } from "yargs/helpers"; -import { generateDefaultConfigFile } from "./utils"; +import { generateDefaultConfigFile } from "./utils.js"; /** * Get the command-line settings */ -export function getCliOptions( - rawArgs: yargs.Argv | undefined, -): CliOptions { +export function getCliOptions(rawArgs: Argv | undefined): CliOptions { if (!rawArgs) { rawArgs = yargs(hideBin(process.argv)); } diff --git a/src/encodeImage.ts b/src/encodeImage.ts index bab9815..96b2b49 100644 --- a/src/encodeImage.ts +++ b/src/encodeImage.ts @@ -1,4 +1,4 @@ -import { CompressionMeta, OutputData } from "./types"; +import { CompressionMeta, OutputData } from "./types.js"; import sharp, { FitEnum } from "sharp"; import { transparentColor } from "./constants.js"; diff --git a/src/prompts.ts b/src/prompts.ts index 42f971b..7dab6e7 100644 --- a/src/prompts.ts +++ b/src/prompts.ts @@ -5,7 +5,7 @@ import { getImageCompressionOptions, srcDirQuestion, } from "./options.js"; -import { CompressionOptionsMap, type ScriptOptions } from "./types"; +import { CompressionOptionsMap, type ScriptOptions } from "./types.js"; import { defaultCompressionOptions, getImageFormatsInFolder, diff --git a/tsconfig.json b/tsconfig.json index e0b6ab5..4011361 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,7 +1,7 @@ { "compilerOptions": { - "module": "ESNext", - "moduleResolution": "node", + "module": "NodeNext", + "moduleResolution": "NodeNext", "target": "ESNext", "esModuleInterop": true, "strict": true,