New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

nuxt-compress

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nuxt-compress

Runs gzip and brotli compression on static assets during Nuxt build

  • 5.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
7K
decreased by-11%
Maintainers
1
Weekly downloads
 
Created
Source

nuxt-compress

A simple static asset compression module for Nuxt that runs Gzip and Brotli compression during the build process.

This is significantly more efficient than compressing files on the fly, especially for Brotli compression, which sacrifices CPU time for greater compression.

For compression during runtime, see the compressor entry in the Nuxt configuration docs

Getting Started

  1. Install the module

    npm install -D nuxt-compress
    

    OR

    yarn add -D nuxt-compress
    
  2. Add "nuxt-compress" to your buildModules

    module.exports = {
      buildModules: ['nuxt-compress'],
    };
    

Configuration

This module provides a simple interface to include compression-webpack-plugin configured for both gzip and brotli compression.

It uses the same configuration options, which can be supplied as a second argument to the entry in "modules" in your nuxt.config.js, or as a distinct entry with the key "nuxt-compress". See the Nuxt Modules guide for more information.

For example:

module.exports = {
  modules: [
    [
      'nuxt-compress',
      {
        gzip: {
          threshold: 8192,
        },
        brotli: {
          threshold: 8192,
        },
      },
    ],
  ],
};

OR

module.exports = {
  modules: ['nuxt-compress'],
  'nuxt-compress': {
    gzip: {
      threshold: 8192,
    },
    brotli: {
      threshold: 8192,
    },
  },
};

Keywords

FAQs

Package last updated on 31 Mar 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc