diff --git a/nuxt.config.ts b/nuxt.config.ts index e6824eb..5eecd95 100644 --- a/nuxt.config.ts +++ b/nuxt.config.ts @@ -6,32 +6,32 @@ import imageminPngquant from 'imagemin-pngquant'; export default defineNuxtConfig({ hooks: { - 'nitro:build:public-assets': async (nitro) => { - console.log(`😈 custom hook imagemin in ${nitro.options.output.publicDir}`) - const output_path = nitro.options.output.publicDir - const filelist = await fs.readdir(output_path, { recursive: true }); - for (let index = 0; index < filelist.length; index++) { - const element = filelist[index]; - const elementFile = await fs.lstat(`${output_path}/${element}`) - if (element.startsWith('_nuxt')) continue - if (elementFile.isFile()) { - if (element.endsWith('.png')) { - const dest = `${output_path}/${element.split('/').slice(0, -1).join('/')}` - const res = await imagemin([`${output_path}/${element}`], { - destination: dest, - plugins: [ - imageminPngquant({ - quality: [0.6, 0.8] - }) - ] - }) - if (res.length) { - console.log(chalk.gray(` compress PNG ${output_path}/${element}`)) - } - } - } - } - } + // 'nitro:build:public-assets': async (nitro) => { + // console.log(`😈 custom hook imagemin in ${nitro.options.output.publicDir}`) + // const output_path = nitro.options.output.publicDir + // const filelist = await fs.readdir(output_path, { recursive: true }); + // for (let index = 0; index < filelist.length; index++) { + // const element = filelist[index]; + // const elementFile = await fs.lstat(`${output_path}/${element}`) + // if (element.startsWith('_nuxt')) continue + // if (elementFile.isFile()) { + // if (element.endsWith('.png')) { + // const dest = `${output_path}/${element.split('/').slice(0, -1).join('/')}` + // const res = await imagemin([`${output_path}/${element}`], { + // destination: dest, + // plugins: [ + // imageminPngquant({ + // quality: [0.6, 0.8] + // }) + // ] + // }) + // if (res.length) { + // console.log(chalk.gray(` compress PNG ${output_path}/${element}`)) + // } + // } + // } + // } + // } }, app: { pageTransition: { name: 'page', mode: 'out-in' }, diff --git a/package-lock.json b/package-lock.json index 4ca0d64..6a23b00 100644 --- a/package-lock.json +++ b/package-lock.json @@ -15,7 +15,6 @@ "@tresjs/cientos": "^3.9.0", "@tresjs/core": "^4.0.2", "@tresjs/nuxt": "^2.1.2", - "glob": "^10.4.2", "imagemin": "^9.0.0", "imagemin-pngquant": "^10.0.0", "marked": "^12.0.2", @@ -23,7 +22,6 @@ "nuxt-anchorscroll": "^1.0.3", "nuxt-icon": "^0.6.10", "nuxt-svgo": "^4.0.1", - "ral-hex-converter": "^1.0.1", "sass": "^1.77.4", "tailwindcss": "^3.4.3", "three": "^0.165.0", @@ -13646,11 +13644,6 @@ "resolved": "https://registry.npmjs.org/radix3/-/radix3-1.1.2.tgz", "integrity": "sha512-b484I/7b8rDEdSDKckSSBA8knMpcdsXudlE/LNL639wFoHKwLbEkQFZHWEYwDC0wa0FKUcCY+GAF73Z7wxNVFA==" }, - "node_modules/ral-hex-converter": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/ral-hex-converter/-/ral-hex-converter-1.0.1.tgz", - "integrity": "sha512-A0C1KzDyUzKRgLLVBmjFmPKnkkq7VvgL6MszNxkPuH6AlFfr6zdEYdWvDWw4tChWql7OAcOOgUvF8wVueopTFg==" - }, "node_modules/randombytes": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", diff --git a/package.json b/package.json index b2feb83..274fcb7 100644 --- a/package.json +++ b/package.json @@ -18,8 +18,6 @@ "@tresjs/cientos": "^3.9.0", "@tresjs/core": "^4.0.2", "@tresjs/nuxt": "^2.1.2", - "imagemin": "^9.0.0", - "imagemin-pngquant": "^10.0.0", "marked": "^12.0.2", "nuxt": "^3.11.2", "nuxt-anchorscroll": "^1.0.3",