shadowwalker / next-pwa

Zero config PWA plugin for Next.js, with workbox 🧰
MIT License
3.71k stars 312 forks source link

How to use next-pwa with axiom and the bundle analyzer in esm #499

Closed FleetAdmiralJakob closed 5 months ago

FleetAdmiralJakob commented 7 months ago

Hi, I actually was not able to implement next-pwa into my esm config alongside the bundle analyzer and axiom:

import { withAxiom } from 'next-axiom'
import withBundleAnalyzer from '@next/bundle-analyzer'
import pkg from './next-i18next.config.js'
const { i18n } = pkg

// create the bundle analyzer config
const withMyBundleAnalyzer = withBundleAnalyzer({
  enabled: process.env.ANALYZE === 'true'
})

/**
 * Run `build` or `dev` with `SKIP_ENV_VALIDATION` to skip env validation.
 * This is especially useful for Docker builds.
 */
!process.env.SKIP_ENV_VALIDATION && (await import('./src/env.mjs'))

/** @type {import("next").NextConfig} */
const config = withMyBundleAnalyzer(
  withAxiom({
    reactStrictMode: true,
    i18n
  })
)
export default config
FleetAdmiralJakob commented 7 months ago

I think my problems are actually caused by the incompatibility with Next 14. I think it is not possible to use this library with Next 14.

theodesp commented 5 months ago

This tool hasn't been updated in 2 years. It's probably dead.

FleetAdmiralJakob commented 5 months ago

Yes, I recommend switching to: https://github.com/DuCanhGH/next-pwa or https://github.com/serwist/serwist