Skip to content

Commit

Permalink
Merge pull request #594 from dc7290/main
Browse files Browse the repository at this point in the history
Release
  • Loading branch information
dc7290 authored Jul 1, 2023
2 parents 4988bfa + b0eb7bc commit 4b23a77
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions src/cli/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,9 +157,11 @@ export const optimizeImages = async ({
}: OptimizeImagesProps) => {
const destDir = path.resolve(cwd, config.outDir ?? 'out')

let manifest: Manifest
let manifest: Manifest = []
try {
manifest = uniqueItems(processManifest(await fs.readFile(manifestJsonPath, 'utf-8')))
if (fs.existsSync(manifestJsonPath)) {
manifest = uniqueItems(processManifest(await fs.readFile(manifestJsonPath, 'utf-8')))
}
} catch (error) {
throw Error(typeof error === 'string' ? error : 'Unexpected error.')
}
Expand Down
2 changes: 1 addition & 1 deletion src/loader/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ type LoaderOptions = {
}

export default async function loader(this: LoaderContext<LoaderOptions>, content: string) {
this.cacheable && this.cacheable()
this.cacheable && this.cacheable(false)
const callback = this.async()

const { dir, isDev } = this.getOptions()
Expand Down

0 comments on commit 4b23a77

Please sign in to comment.