Git Product home page Git Product logo

compression's People

Contributors

baroshem avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

compression's Issues

Typing for defineNuxtConfig options ?

Hi there ! Currently working on a template for nuxt 3 projects and installed your module for optimisation purposes. So far, it works great.. only thing though, TS complains about the "compression" property in the defineNuxtConfig. Is there any types that I should be installing ?

Nuxt config

Thanks !

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')
        }
      }
    ]
  ],

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',
  }
})

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.