-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ISSUE in nuxt-precompress module #229
Comments
same here |
me too |
Nuxt precompress module didnt work for me. Nuxt automatically compress the files in gzip format as it runs Gzip compression during the build process. Nuxt-delay-hydration module restrict any third party script to run until hydration is completed. which increase performance of Nuxt application. |
nuxt-precompress is only nuxt2 compatible for now, as it depends on old webpack, if there is interest in upgrading it for Nuxt 3 I'll do it. |
You should install the "vite-plugin-compression" plugin in nuxt3,and like this to using 👇 import viteCompression from 'vite-plugin-compression';
export default defineNuxtConfig({
vite: {
plugins: [
viteCompression({
verbose: true, // 是否在控制台中输出压缩结果
disable: false,
threshold: 10240, // 如果体积大于阈值,将被压缩,单位为b,体积过小时请不要压缩,以免适得其反
algorithm: 'gzip', // 压缩算法,可选['gzip',' brotliccompress ','deflate ','deflateRaw']
ext: '.gz',
deleteOriginFile: false, // 源文件压缩后是否删除
})
]
}
}); |
i have added the nuxt-precompress module in the module section of nuxt.config.ts and getting this error
followed the step mentioed in warning, set type: module in package.json.. still its the same issue.
The text was updated successfully, but these errors were encountered: