🕋Assets Compression module for Nuxt 3

Overview

@nuxt-modules/compression

@nuxt-modules/compression

npm version npm downloads Github Actions CI Codecov License

Assets Compression module for Nuxt 3

Features

📖  Read the documentation

Setup

yarn add @nuxt-modules/compression # yarn
npm i @nuxt-modules/compression # npm

Basic usage

Firstly, you need to add @nuxt-modules/compression to your Nuxt config.

// nuxt.config.js

{
  buildModules: [
    ['@nuxt-modules/compression', {
      algorithm: 'brotliCompress'
    }]
  ]
}

And that's it! Now, the brotli compression will compress your assets. For more configuration options (like brotli compression, filter assets, etc) please, visit the official docs.

Development

  1. Clone this repository
  2. Install dependencies using yarn install or npm install
  3. Start development server using yarn dev or npm run dev

License

MIT License

You might also like...

Swagger UI is a collection of HTML, JavaScript, and CSS assets that dynamically generate beautiful documentation from a Swagger-compliant API.

Swagger UI is a collection of HTML, JavaScript, and CSS assets that dynamically generate beautiful documentation from a Swagger-compliant API.

Introduction Swagger UI allows anyone — be it your development team or your end consumers — to visualize and interact with the API’s resources without

Dec 28, 2022

The ManageYourCompany 📈 project is a project that creates, deletes, updates companies, units and assets.

The ManageYourCompany 📈 project is a project that creates, deletes, updates companies, units and assets. The rule is that every company has several units and the units have several assets, these assets are machines with several fields: Name, status, person in charge, image, among others... This is a project in order to exercise my Backend skills with NodeJs and front with react.

Feb 9, 2022

A tool to simplify importing custom assets in Minecraft

BAMO - Block And Move On A tool to simplify importing custom assets in Minecraft Currently only allows you to quickly prototype models in-game, but fu

Jul 15, 2022

Get discord application's assets in case you don't have them on your PC

Get discord application's assets in case you don't have them on your PC

get-discord-app-assets Get discord application's assets in case you don't have them on your PC (this is also the reason why I made this script) I came

Dec 25, 2022

Programmatically upload NFT assets to OpenSea.io for free

Programmatically upload NFT assets to OpenSea.io for free

OpenSea Uploader This is the example repository for my blog post How to Mint 100,000 NFTs For Free. Please note that this is merely a proof of concept

Sep 15, 2022

Source code and 3D assets for the Rings (for Loot) NFT project

Source code and 3D assets for the Rings (for Loot) NFT project

Rings (for Loot) Rings (for Loot) is the first and largest 3D interpretation of an entire category in Loot. Adventurers, builders, and artists are enc

Dec 24, 2022

A file manager plugin for logseq(Search unused assets file)

A file manager plugin for logseq(Search unused assets file)

logseq-plugin-file-manager Search files from assets and draws but not used in journals or pages. Please backup files before operation, and before dele

Dec 23, 2022

Yet another library for generating NFT artwork, uploading NFT assets and metadata to IPFS, deploying NFT smart contracts, and minting NFT collections

eznft Yet another library for generating NFT artwork, uploading NFT assets and metadata to IPFS, deploying NFT smart contracts, and minting NFT collec

Sep 21, 2022

In this project, I built a simple HTML list of To-Do tasks. This simple web page was built using Webpack, creating everything from a JavaScript index file that imported all the modules and assets

In this project, I built a simple HTML list of To-Do tasks. This simple web page was built using Webpack, creating everything from a JavaScript index file that imported all the modules and assets

To Do List In this project, I built a simple HTML list of To-Do tasks. This simple web page was built using Webpack, creating everything from a JavaSc

Mar 31, 2022
Comments
  • deleteOriginFile options is not working as expected

    deleteOriginFile options is not working as expected

    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')
            }
          }
        ]
      ],
    
    bug 
    opened by BenjaminOddou 8
  • vite-plugin-compression module missing when building the app

    vite-plugin-compression module missing when building the app

    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',
      }
    })
    
    bug 
    opened by BenjaminOddou 3
  • Allow for exclusion of specific files

    Allow for exclusion of specific files

    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).

    enhancement 
    opened by nathanchase 0
  • refactor to offical nuxt 3 module structure

    refactor to offical nuxt 3 module structure

    Is your feature request related to a problem? Please describe.

    Describe the solution you'd like

    https://v3.nuxtjs.org/docs/advanced/modules

    Describe alternatives you've considered

    Additional context

    enhancement 
    opened by Baroshem 2
Releases(v0.1.0)
Owner
Nuxt Modules
Collection of useful Nuxt 3 modules
Nuxt Modules
Grupprojekt för kurserna 'Javascript med Ramverk' och 'Agil Utveckling'

JavaScript-med-Ramverk-Laboration-3 Grupprojektet för kurserna Javascript med Ramverk och Agil Utveckling. Utvecklingsguide För information om hur utv

Svante Jonsson IT-Högskolan 3 May 18, 2022
Hemsida för personer i Sverige som kan och vill erbjuda boende till människor på flykt

Getting Started with Create React App This project was bootstrapped with Create React App. Available Scripts In the project directory, you can run: np

null 4 May 3, 2022
Kurs-repo för kursen Webbserver och Databaser

Webbserver och databaser This repository is meant for CME students to access exercises and codealongs that happen throughout the course. I hope you wi

null 14 Jan 3, 2023
🌉 Experience Nuxt 3 features on existing Nuxt 2 projects

?? Nuxt Bridge Experience Nuxt 3 features on existing Nuxt 2 projects. Bridge is a forward-compatibility layer that allows you to experience many of t

Nuxt 180 Jan 5, 2023
High performance (de)compression in an 8kB package

fflate High performance (de)compression in an 8kB package Why fflate? fflate (short for fast flate) is the fastest, smallest, and most versatile pure

null 1.4k Dec 28, 2022
🗜️ AstroJS compression utilities. Compress CSS, HTML, JavaScript and more.

astro-compress ??️ This Astro integration brings compression utilities to your Astro project. csso html-minifier-terser terser Installation There are

Nikola Hristov 144 Jan 8, 2023
An online .txt file compressor, de-compressor tool which uses Huffman Coding for Lossless data compression.

Text File Compressor De-compressor Web App This webapp uses Huffman Coding for Text Compression and De-compression. Made with JavaScript, HTML5 and CS

Samir Paul 10 Dec 25, 2022
A free and open source file compression tool, Compressor makes your files smaller!

Compressor A free and open source file compression tool, Compressor makes your files smaller! Languages: ???? 中文 | ???? English Feature Internationali

五月君 100 Dec 24, 2022
An npm package for demonstration purposes using TypeScript to build for both the ECMAScript Module format (i.e. ESM or ES Module) and CommonJS Module format. It can be used in Node.js and browser applications.

An npm package for demonstration purposes using TypeScript to build for both the ECMAScript Module format (i.e. ESM or ES Module) and CommonJS Module format. It can be used in Node.js and browser applications.

Snyk Labs 57 Dec 28, 2022
Wikipedia using only static assets & no backend

http://static.wiki Build a read-only Wikipedia using CSS, JS, WASM, and SQLite A proof-of-concept inspired and enabled by Hosting SQLite Databases on

null 540 Jan 1, 2023