vite-plugin-minipic icon indicating copy to clipboard operation
vite-plugin-minipic copied to clipboard

build报错,ENOENT: no such file or directory, open xxx

Open yangxu52 opened this issue 1 year ago • 3 comments

node:20.15.x vite:5.3.x vite-plugin-minipic:1.1.3

我的配置

{
    sharpOptions: {
        avif: { lossless: true }, 
    },
    convert: [
        { from: 'png', to: 'avif' },
        { from: 'jpg', to: 'avif' },
        { from: 'jpeg', to: 'avif' },
    ],
    cache: true, 
}

build时候报错:(可复现)

[vite-plugin-minipic] ENOENT: no such file or directory, open 'D:\Code\project\dist\D:\Code\project\public\data\images\posz.avif'
    at Object.openSync (node:fs:581:18)
    at Object.writeFileSync (node:fs:2365:35)
    at changePublicOutput (file:///D:/Code/project/node_modules/.pnpm/[email protected][email protected]/node_modules/vite-plugin-minipic/dist/index.mjs:288:9)
    at file:///D:/Code/project/node_modules/.pnpm/[email protected][email protected]/node_modules/vite-plugin-minipic/dist/index.mjs:265:7
    at async Promise.all (index 0)
    at async handleGenerateImgFiles (file:///D:/Code/project/node_modules/.pnpm/[email protected][email protected]/node_modules/vite-plugin-minipic/dist/index.mjs:268:3)
    at async handleGeneratePublic (file:///D:/Code/project/node_modules/.pnpm/[email protected][email protected]/node_modules/vite-plugin-minipic/dist/index.mjs:392:3)
    at async Object.generateBundle (file:///D:/Code/project/node_modules/.pnpm/[email protected][email protected]/node_modules/vite-plugin-minipic/dist/index.mjs:405:7)
    at async Bundle.generate (file:///D:/Code/project/node_modules/.pnpm/[email protected]/node_modules/rollup/dist/es/shared/node-entry.js:18153:9)
    at async file:///D:/Code/project/node_modules/.pnpm/[email protected]/node_modules/rollup/dist/es/shared/node-entry.js:20692:27
    at async catchUnfinishedHookActions (file:///D:/Code/project/node_modules/.pnpm/[email protected]/node_modules/rollup/dist/es/shared/node-entry.js:20119:16)
    at async build (file:///D:/Code/project/node_modules/.pnpm/[email protected]_@[email protected][email protected][email protected]/node_modules/vite/dist/node/chunks/dep-CzJTQ5q7.js:65741:16)
    at async CAC.<anonymous> (file:///D:/Code/project/node_modules/.pnpm/[email protected]_@[email protected][email protected][email protected]/node_modules/vite/dist/node/cli.js:828:5)
 ELIFECYCLE  Command failed with exit code 1.

 1. 我想排除public/data目录下的所有文件,但是在exclude中使用正则去匹配路径,都失败了,想请教如何编写对应正则。  2. 修复bug。

yangxu52 avatar Jul 09 '24 03:07 yangxu52