frenchrabbit / nuxt-precompress Goto Github PK
View Code? Open in Web Editor NEWNuxt module for gzip and Brotli auto compress and serve
Nuxt module for gzip and Brotli auto compress and serve
Is this plugin supported with the nuxt-bridge/nuxt3?
Version used in this package does not support node 18+. Support was added with v6.1.2
https://github.com/webpack-contrib/compression-webpack-plugin/releases/tag/v6.1.2
In the first place, thank you SO MUCH for this library.
But now I have an issue: I'm using large image files that are larger than the "recommended size limit (244KiB)", and this is why I was looking for server-side compression in the first place.
But it seems that "big" files (in my case they are in the assets
folder) are not compressed (but small files (smaller than 244KiB) are).
Do you have any clue about why this happens and how to fix it?
Thank you in advance for your answer.
The compression-webpack-plugin
dependency should only be required when building a site.
Currently the dependency is also required when running nuxt-cli start
which doesn't make a lot of sense to me.
The issue currently is in order to use nuxt-precompress
I have to bundle a bunch of unused code (including all of webpack) with my deployments.
I noticed that no matter what level of Brotli compression I specify in the options, files are always compressed with the maximum level (11).
Then I realized that the README.md file of the library has this invalid instruction:
brotli: {
// other options...
compressionOptions: { level: 11 },
},
According to the documentation, for Brotli, the level
option should be passed like this:
module.exports = {
plugins: [
new CompressionPlugin({
// other options...
compressionOptions: {
params: {
[zlib.constants.BROTLI_PARAM_QUALITY]: 11,
},
}
}),
],
};
Please, update the README.md.
P.S. Thanks for the library!
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.