Giter VIP home page Giter VIP logo

Comments (4)

userquin avatar userquin commented on July 18, 2024

@ateliee provide minimal repro

from nuxt.

ateliee avatar ateliee commented on July 18, 2024

@userquin

It seems that nuxt-lodash is transpiled on the dev server

add @vite-pwa/nuxt module and pwa config in nuxt.config.ts

// https://nuxt.com/docs/api/configuration/nuxt-config
import {resolve} from "path";
import {readdirSync} from "fs";

export default defineNuxtConfig({
  modules: [
    'nuxt-lodash',
    '@vite-pwa/nuxt',
  ],
  pwa: {
    workbox: {
      mode: 'development',
      runtimeCaching: [
        {
          urlPattern: new RegExp(`\\/.+\\.(jpg|css)(\\?.*)?$`, 'i'),
          handler: 'StaleWhileRevalidate',
          options: {
            cacheName: 'resource',
            expiration: {
              maxAgeSeconds: 60 * 60 * 24 * 365,
              maxEntries: 10000,
              purgeOnQuotaError: true,
            },
          },
        }
      ],
      sourcemap: true,
      skipWaiting: true,
      clientsClaim: true,
      navigateFallback: null,
    },
    mode: 'development',
    registerType: 'autoUpdate',
    injectRegister: 'auto',
    devOptions: {
      enabled: true,
      type: 'module',
    },
  },
  devtools: { enabled: true }
})

add @vite-pwa/nuxt and nuxt-lodash in package.json

{
  "name": "nuxt-app",
  "private": true,
  "scripts": {
    "build": "nuxt build",
    "dev": "nuxt dev",
    "generate": "nuxt generate",
    "preview": "nuxt preview",
    "postinstall": "nuxt prepare"
  },
  "devDependencies": {
    "@nuxt/devtools": "^0.7.1",
    "@vite-pwa/nuxt": "^0.1.0",
    "nuxt": "^3.0.0",
    "nuxt-lodash": "^2.4.0",
    "typescript": "^4.9.3"
  }
}

from nuxt.

userquin avatar userquin commented on July 18, 2024

try update nuxt-lodash to latest version

from nuxt.

ateliee avatar ateliee commented on July 18, 2024

@userquin
nuxt-lodash is latest version (2.5.0) installed.

https://www.npmjs.com/package/nuxt-lodash

from nuxt.

Related Issues (20)

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.