baroshem / compression Goto Github PK
View Code? Open in Web Editor NEWπ Compression module for Nuxt 3
Home Page: https://compression-nm.netlify.app/
License: MIT License
π Compression module for Nuxt 3
Home Page: https://compression-nm.netlify.app/
License: MIT License
Hey!
Since Nitro supports a compressPublicAssets
option, I wonder about the differences between it and the module
Could be helpful for the users too
nuxt: 3.5.3
Copy paste the example.
Migration guide:
https://nuxt.com/docs/migration/configuration#migration-1
Errors.
https://v3.nuxtjs.org/docs/advanced/modules
Hello,
I'd like to report that the deleteOriginFile: true
is not working as expected and return an error :
ERROR Rollup error: Could not load /Users/User/Documents/nuxt-app/.nuxt/dist/server/client.manifest.mjs (imported by node_modules/nuxt/dist/core/runtime/nitro/renderer.mjs): ENOENT: no such file or directory, open '/Users/User/Documents/nuxt-app/.nuxt/dist/server/client.manifest.mjs'
ERROR Could not load /Users/User/Documents/nuxt-app/.nuxt/dist/server/client.manifest.mjs (imported by node_modules/nuxt/dist/core/runtime/nitro/renderer.mjs): ENOENT: no such file or directory, open '/Users/User/Documents/nuxt-app/.nuxt/dist/server/client.manifest.mjs'
here is my nuxt.config.ts
file :
buildModules: [
[
'@nuxt-modules/compression',
{
algorithm: 'gzip',
filter: /\.(js|mjs|css|html)$/i,
deleteOriginFile: true,
success: () => {
console.log('β
Success gzip compression')
}
}
]
],
I'm having an issue where the compression is compressing the manifest.json
file generated by https://github.com/kevinmarrec/nuxt-pwa-module to manifest.json.br
which prevents the PWA manifest from being seen by the browser.
I'd like to be able to either manually exclude a file from compression, or be able to exclude an entire mime-type (.json).
Hello π,
I encountered a bug with @nuxt-modules/compression (v0.1.0)
when building the app with Nuxt 3 (v3.0.0-rc.6) I have this error message :
Nuxt CLI v3.0.0-rc.6 11:28:46
ERROR Cannot find module 'vite-plugin-compression' 11:28:48
Require stack:
- /Users/User/Documents/Nuxt3App/node_modules/@nuxt-modules/compression/dist/module.cjs
Require stack:
- node_modules/@nuxt-modules/compression/dist/module.cjs
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
at Function.resolve (node:internal/modules/cjs/helpers:108:19)
at _resolve (node_modules/jiti/dist/jiti.js:1:108226)
at jiti (node_modules/jiti/dist/jiti.js:1:110413)
at node_modules/@nuxt-modules/compression/dist/module.cjs:4:25
at jiti (node_modules/jiti/dist/jiti.js:1:112282)
at requireModule (node_modules/@nuxt/kit/dist/index.mjs:295:26)
at normalizeModule (node_modules/@nuxt/kit/dist/index.mjs:448:53)
at installModule (node_modules/@nuxt/kit/dist/index.mjs:431:47)
at initNuxt (node_modules/nuxt/dist/index.mjs:1421:13)
I know that this plugin is based on vite-plugin-compression but I was wondering if it was needed to install this dependency as well.
My config :
// nuxt.config.ts|js
import { defineNuxtConfig } from 'nuxt'
export default defineNuxtConfig({
buildModules: [
[
'@nuxt-modules/compression',
{
algorithm: 'brotliCompress'
},
],
],
})
Also I remarked that the following config was skipped on the latest release of Nuxt 3 (v3.0.0-rc.6):
// nuxt.config.ts|js
import { defineNuxtConfig } from 'nuxt'
export default defineNuxtConfig({
compression: {
algorithm: 'brotliCompress',
}
})
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.