From 4c6aa5824ca20d15e7cf28ec28a5991f1f64ecc9 Mon Sep 17 00:00:00 2001 From: DuCanhGH <75556609+DuCanhGH@users.noreply.github.com> Date: Sat, 1 Jul 2023 11:36:01 +0700 Subject: [PATCH] fix(next-pwa): fixed build crashing when swcMinify is set to false --- .changeset/eighty-bags-beg.md | 5 + docs/content/next-pwa/configuring.mdx | 2 + packages/next-pwa/src/types.ts | 4 +- .../src/webpack-builders/constants.ts | 22 ---- .../next-pwa/src/webpack-builders/utils.ts | 32 ++++- packages/utils/src/index.ts | 2 +- packages/utils/src/swc-minify.ts | 112 ---------------- packages/utils/src/terser-minify.ts | 124 ++++++++++++++++++ 8 files changed, 160 insertions(+), 143 deletions(-) create mode 100644 .changeset/eighty-bags-beg.md delete mode 100644 packages/next-pwa/src/webpack-builders/constants.ts delete mode 100644 packages/utils/src/swc-minify.ts create mode 100644 packages/utils/src/terser-minify.ts diff --git a/.changeset/eighty-bags-beg.md b/.changeset/eighty-bags-beg.md new file mode 100644 index 00000000..11ba7236 --- /dev/null +++ b/.changeset/eighty-bags-beg.md @@ -0,0 +1,5 @@ +--- +"@ducanh2912/next-pwa": patch +--- + +fix(next-pwa): fixed build crashing when swcMinify is set to false diff --git a/docs/content/next-pwa/configuring.mdx b/docs/content/next-pwa/configuring.mdx index bec650a9..7d33ec36 100644 --- a/docs/content/next-pwa/configuring.mdx +++ b/docs/content/next-pwa/configuring.mdx @@ -79,6 +79,8 @@ export default withPWA({ - `extendDefaultRuntimeCaching` — Extend the default `runtimeCaching` array. Only effective when `runtimeCaching` is specified. +- `swcMinify` — Use [`swc`](https://swc.rs) to minify the custom worker, fallback worker,... + ### Experimental - `aggressiveFrontEndNavCaching` — Cache every `` and `