Skip to content

Commit

Permalink
fix: mjs support
Browse files Browse the repository at this point in the history
  • Loading branch information
anncwb committed Jan 29, 2022
1 parent 624e88c commit 1285598
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
3 changes: 2 additions & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
"debug": "^4.3.3",
"esbuild": "^0.14.14",
"fs-extra": "^10.0.0",
"gifsicle": "5.2.0",
"imagemin": "^7.0.1",
"imagemin-gifsicle": "^7.0.0",
"imagemin-jpegtran": "^7.0.0",
Expand All @@ -60,7 +61,7 @@
"imagemin-svgo": "^9.0.0",
"imagemin-webp": "^6.0.0",
"jpegtran-bin": "^6.0.1",
"gifsicle": "5.2.0"
"pathe": "^0.2.0"
},
"peerDependencies": {
"vite": ">=2.0.0"
Expand Down
8 changes: 4 additions & 4 deletions packages/core/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { Plugin, ResolvedConfig } from 'vite'
import type { VitePluginImageMin } from '../src/types'
import path from 'path'
import type { VitePluginImageMin } from './types'
import path from 'pathe'
import fs from 'fs-extra'
import {
isNotFalse,
Expand All @@ -10,7 +10,7 @@ import {
readAllFiles,
} from '../src/utils'
import chalk from 'chalk'
import { debug as Debug } from 'debug'
import Debug from 'debug'

import imagemin from 'imagemin'
import imageminGif from 'imagemin-gifsicle'
Expand All @@ -21,7 +21,7 @@ import imageminSvgo from 'imagemin-svgo'
import imageminWebp from 'imagemin-webp'
import imageminJpegTran from 'imagemin-jpegtran'

const debug = Debug('vite-plugin-imagemin')
const debug = Debug.debug('vite-plugin-imagemin')

const extRE = /\.(png|jpeg|gif|jpg|bmp|svg)$/i

Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/utils.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import fs from 'fs'
import fs from 'fs-extra'
import path from 'path'

export const isFunction = (arg: unknown): arg is (...args: any[]) => any =>
Expand Down
3 changes: 2 additions & 1 deletion pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 1285598

Please sign in to comment.