Bot releases are visible (Hide)
Published by github-actions[bot] 9 months ago
Published by github-actions[bot] 9 months ago
Published by github-actions[bot] 9 months ago
Published by github-actions[bot] 9 months ago
Published by github-actions[bot] 9 months ago
Published by github-actions[bot] 9 months ago
30e4c25
Thanks @DuCanhGH! - chore(peerDeps): bump minimum supported TypeScript and Node.js version
# Change to your preferred way of updating Node.js
nvm use 18
# Change to your package manager
npm i -D typescript@5
defdd5a
Thanks @DuCanhGH! - refactor(js): migrate to ESM-only
Serwist is now an ESM-only project.
This was done because our tooling around supporting CJS had always been crappy: it was slow, had no way of supporting emitting .d.cts
(we used to copy .d.ts
to .d.cts
), and was too error-prone (there were various issues of our builds crashing due to an ESM-only package slipping in).
If you already use ESM, there's nothing to be done. Great! Otherwise, to migrate:
Migrate to ESM if possible.
Otherwise, use dynamic imports. For example, to migrate to the new @serwist/next
:
// @ts-check
const withSerwist = require("@serwist/next").default({
cacheOnFrontEndNav: true,
swSrc: "app/sw.ts",
swDest: "public/sw.js",
});
/** @type {import("next").NextConfig} */
const nextConfig = {
reactStrictMode: true,
};
module.exports = withSerwist(nextConfig);
// @ts-check
/** @type {import("next").NextConfig} */
const nextConfig = {
reactStrictMode: true,
};
module.exports = async () => {
const withSerwist = (await import("@serwist/next")).default({
cacheOnFrontEndNav: true,
swSrc: "app/sw.ts",
swDest: "public/sw.js",
});
return withSerwist(nextConfig);
};
I know that most of our current userbase use Next.js, which still suggests using a CJS config file, so I am really sorry for the trouble I have caused for you :( However, what needs to be done has to be done. It was time to migrate and get rid of old, legacy things.
defdd5a
, 30e4c25
, defdd5a
]:
Published by github-actions[bot] 9 months ago
defdd5a
Thanks @DuCanhGH! - refactor(js): migrate to ESM-only
Serwist is now an ESM-only project.
This was done because our tooling around supporting CJS had always been crappy: it was slow, had no way of supporting emitting .d.cts
(we used to copy .d.ts
to .d.cts
), and was too error-prone (there were various issues of our builds crashing due to an ESM-only package slipping in).
If you already use ESM, there's nothing to be done. Great! Otherwise, to migrate:
Migrate to ESM if possible.
Otherwise, use dynamic imports. For example, to migrate to the new @serwist/next
:
// @ts-check
const withSerwist = require("@serwist/next").default({
cacheOnFrontEndNav: true,
swSrc: "app/sw.ts",
swDest: "public/sw.js",
});
/** @type {import("next").NextConfig} */
const nextConfig = {
reactStrictMode: true,
};
module.exports = withSerwist(nextConfig);
// @ts-check
/** @type {import("next").NextConfig} */
const nextConfig = {
reactStrictMode: true,
};
module.exports = async () => {
const withSerwist = (await import("@serwist/next")).default({
cacheOnFrontEndNav: true,
swSrc: "app/sw.ts",
swDest: "public/sw.js",
});
return withSerwist(nextConfig);
};
I know that most of our current userbase use Next.js, which still suggests using a CJS config file, so I am really sorry for the trouble I have caused for you :( However, what needs to be done has to be done. It was time to migrate and get rid of old, legacy things.
30e4c25
, defdd5a
]:
Published by github-actions[bot] 9 months ago
30e4c25
Thanks @DuCanhGH! - chore(peerDeps): bump minimum supported TypeScript and Node.js version
# Change to your preferred way of updating Node.js
nvm use 18
# Change to your package manager
npm i -D typescript@5
defdd5a
Thanks @DuCanhGH! - refactor(js): migrate to ESM-only
Serwist is now an ESM-only project.
This was done because our tooling around supporting CJS had always been crappy: it was slow, had no way of supporting emitting .d.cts
(we used to copy .d.ts
to .d.cts
), and was too error-prone (there were various issues of our builds crashing due to an ESM-only package slipping in).
If you already use ESM, there's nothing to be done. Great! Otherwise, to migrate:
Migrate to ESM if possible.
Otherwise, use dynamic imports. For example, to migrate to the new @serwist/next
:
// @ts-check
const withSerwist = require("@serwist/next").default({
cacheOnFrontEndNav: true,
swSrc: "app/sw.ts",
swDest: "public/sw.js",
});
/** @type {import("next").NextConfig} */
const nextConfig = {
reactStrictMode: true,
};
module.exports = withSerwist(nextConfig);
// @ts-check
/** @type {import("next").NextConfig} */
const nextConfig = {
reactStrictMode: true,
};
module.exports = async () => {
const withSerwist = (await import("@serwist/next")).default({
cacheOnFrontEndNav: true,
swSrc: "app/sw.ts",
swDest: "public/sw.js",
});
return withSerwist(nextConfig);
};
I know that most of our current userbase use Next.js, which still suggests using a CJS config file, so I am really sorry for the trouble I have caused for you :( However, what needs to be done has to be done. It was time to migrate and get rid of old, legacy things.
defdd5a
, 30e4c25
, defdd5a
, 30e4c25
, 04d2619
]:
Published by github-actions[bot] 9 months ago
30e4c25
Thanks @DuCanhGH! - chore(peerDeps): bump minimum supported TypeScript and Node.js version
# Change to your preferred way of updating Node.js
nvm use 18
# Change to your package manager
npm i -D typescript@5
defdd5a
Thanks @DuCanhGH! - refactor(js): migrate to ESM-only
Serwist is now an ESM-only project.
This was done because our tooling around supporting CJS had always been crappy: it was slow, had no way of supporting emitting .d.cts
(we used to copy .d.ts
to .d.cts
), and was too error-prone (there were various issues of our builds crashing due to an ESM-only package slipping in).
If you already use ESM, there's nothing to be done. Great! Otherwise, to migrate:
Migrate to ESM if possible.
Otherwise, use dynamic imports. For example, to migrate to the new @serwist/next
:
// @ts-check
const withSerwist = require("@serwist/next").default({
cacheOnFrontEndNav: true,
swSrc: "app/sw.ts",
swDest: "public/sw.js",
});
/** @type {import("next").NextConfig} */
const nextConfig = {
reactStrictMode: true,
};
module.exports = withSerwist(nextConfig);
// @ts-check
/** @type {import("next").NextConfig} */
const nextConfig = {
reactStrictMode: true,
};
module.exports = async () => {
const withSerwist = (await import("@serwist/next")).default({
cacheOnFrontEndNav: true,
swSrc: "app/sw.ts",
swDest: "public/sw.js",
});
return withSerwist(nextConfig);
};
I know that most of our current userbase use Next.js, which still suggests using a CJS config file, so I am really sorry for the trouble I have caused for you :( However, what needs to be done has to be done. It was time to migrate and get rid of old, legacy things.
30e4c25
Thanks @DuCanhGH! - fix(sw): disable runtimeCaching
, fallbacks
, and registerRuntimeCaching
in development mode
import { installSerwist } from "@serwist/sw";
declare global {
interface WorkerGlobalScope {
__WB_FORCE_RUNTIME_CACHING: boolean;
}
}
self.__WB_FORCE_RUNTIME_CACHING = true;
installSerwist({
runtimeCaching: [
// ...
],
});
04d2619
Thanks @DuCanhGH! - refactor(sw): moved @serwist/build.RuntimeCaching
to @serwist/sw
runtimeCaching
is now a part of @serwist/sw
rather than @serwist/build
, it makes more sense to move the types there as well.import type { StrategyName, RuntimeCaching } from "@serwist/build";
import type { StrategyName, RuntimeCaching } from "@serwist/sw";
30e4c25
, defdd5a
]:
Published by github-actions[bot] 9 months ago
defdd5a
Thanks @DuCanhGH! - refactor(js): migrate to ESM-only
Serwist is now an ESM-only project.
This was done because our tooling around supporting CJS had always been crappy: it was slow, had no way of supporting emitting .d.cts
(we used to copy .d.ts
to .d.cts
), and was too error-prone (there were various issues of our builds crashing due to an ESM-only package slipping in).
If you already use ESM, there's nothing to be done. Great! Otherwise, to migrate:
Migrate to ESM if possible.
Otherwise, use dynamic imports. For example, to migrate to the new @serwist/next
:
// @ts-check
const withSerwist = require("@serwist/next").default({
cacheOnFrontEndNav: true,
swSrc: "app/sw.ts",
swDest: "public/sw.js",
});
/** @type {import("next").NextConfig} */
const nextConfig = {
reactStrictMode: true,
};
module.exports = withSerwist(nextConfig);
// @ts-check
/** @type {import("next").NextConfig} */
const nextConfig = {
reactStrictMode: true,
};
module.exports = async () => {
const withSerwist = (await import("@serwist/next")).default({
cacheOnFrontEndNav: true,
swSrc: "app/sw.ts",
swDest: "public/sw.js",
});
return withSerwist(nextConfig);
};
I know that most of our current userbase use Next.js, which still suggests using a CJS config file, so I am really sorry for the trouble I have caused for you :( However, what needs to be done has to be done. It was time to migrate and get rid of old, legacy things.
30e4c25
, defdd5a
]:
Published by github-actions[bot] 9 months ago
defdd5a
Thanks @DuCanhGH! - refactor(js): migrate to ESM-only
Serwist is now an ESM-only project.
This was done because our tooling around supporting CJS had always been crappy: it was slow, had no way of supporting emitting .d.cts
(we used to copy .d.ts
to .d.cts
), and was too error-prone (there were various issues of our builds crashing due to an ESM-only package slipping in).
If you already use ESM, there's nothing to be done. Great! Otherwise, to migrate:
Migrate to ESM if possible.
Otherwise, use dynamic imports. For example, to migrate to the new @serwist/next
:
// @ts-check
const withSerwist = require("@serwist/next").default({
cacheOnFrontEndNav: true,
swSrc: "app/sw.ts",
swDest: "public/sw.js",
});
/** @type {import("next").NextConfig} */
const nextConfig = {
reactStrictMode: true,
};
module.exports = withSerwist(nextConfig);
// @ts-check
/** @type {import("next").NextConfig} */
const nextConfig = {
reactStrictMode: true,
};
module.exports = async () => {
const withSerwist = (await import("@serwist/next")).default({
cacheOnFrontEndNav: true,
swSrc: "app/sw.ts",
swDest: "public/sw.js",
});
return withSerwist(nextConfig);
};
I know that most of our current userbase use Next.js, which still suggests using a CJS config file, so I am really sorry for the trouble I have caused for you :( However, what needs to be done has to be done. It was time to migrate and get rid of old, legacy things.
30e4c25
, defdd5a
]:
Published by github-actions[bot] 9 months ago
30e4c25
Thanks @DuCanhGH! - chore(peerDeps): bump minimum supported TypeScript and Node.js version
# Change to your preferred way of updating Node.js
nvm use 18
# Change to your package manager
npm i -D typescript@5
defdd5a
Thanks @DuCanhGH! - refactor(js): migrate to ESM-only
Serwist is now an ESM-only project.
This was done because our tooling around supporting CJS had always been crappy: it was slow, had no way of supporting emitting .d.cts
(we used to copy .d.ts
to .d.cts
), and was too error-prone (there were various issues of our builds crashing due to an ESM-only package slipping in).
If you already use ESM, there's nothing to be done. Great! Otherwise, to migrate:
Migrate to ESM if possible.
Otherwise, use dynamic imports. For example, to migrate to the new @serwist/next
:
// @ts-check
const withSerwist = require("@serwist/next").default({
cacheOnFrontEndNav: true,
swSrc: "app/sw.ts",
swDest: "public/sw.js",
});
/** @type {import("next").NextConfig} */
const nextConfig = {
reactStrictMode: true,
};
module.exports = withSerwist(nextConfig);
// @ts-check
/** @type {import("next").NextConfig} */
const nextConfig = {
reactStrictMode: true,
};
module.exports = async () => {
const withSerwist = (await import("@serwist/next")).default({
cacheOnFrontEndNav: true,
swSrc: "app/sw.ts",
swDest: "public/sw.js",
});
return withSerwist(nextConfig);
};
I know that most of our current userbase use Next.js, which still suggests using a CJS config file, so I am really sorry for the trouble I have caused for you :( However, what needs to be done has to be done. It was time to migrate and get rid of old, legacy things.
30e4c25
, defdd5a
]:
Published by github-actions[bot] 9 months ago
defdd5a
Thanks @DuCanhGH! - refactor(js): migrate to ESM-only
Serwist is now an ESM-only project.
This was done because our tooling around supporting CJS had always been crappy: it was slow, had no way of supporting emitting .d.cts
(we used to copy .d.ts
to .d.cts
), and was too error-prone (there were various issues of our builds crashing due to an ESM-only package slipping in).
If you already use ESM, there's nothing to be done. Great! Otherwise, to migrate:
Migrate to ESM if possible.
Otherwise, use dynamic imports. For example, to migrate to the new @serwist/next
:
// @ts-check
const withSerwist = require("@serwist/next").default({
cacheOnFrontEndNav: true,
swSrc: "app/sw.ts",
swDest: "public/sw.js",
});
/** @type {import("next").NextConfig} */
const nextConfig = {
reactStrictMode: true,
};
module.exports = withSerwist(nextConfig);
// @ts-check
/** @type {import("next").NextConfig} */
const nextConfig = {
reactStrictMode: true,
};
module.exports = async () => {
const withSerwist = (await import("@serwist/next")).default({
cacheOnFrontEndNav: true,
swSrc: "app/sw.ts",
swDest: "public/sw.js",
});
return withSerwist(nextConfig);
};
I know that most of our current userbase use Next.js, which still suggests using a CJS config file, so I am really sorry for the trouble I have caused for you :( However, what needs to be done has to be done. It was time to migrate and get rid of old, legacy things.
30e4c25
, defdd5a
]:
Published by github-actions[bot] 9 months ago
defdd5a
Thanks @DuCanhGH! - refactor(js): migrate to ESM-only
Serwist is now an ESM-only project.
This was done because our tooling around supporting CJS had always been crappy: it was slow, had no way of supporting emitting .d.cts
(we used to copy .d.ts
to .d.cts
), and was too error-prone (there were various issues of our builds crashing due to an ESM-only package slipping in).
If you already use ESM, there's nothing to be done. Great! Otherwise, to migrate:
Migrate to ESM if possible.
Otherwise, use dynamic imports. For example, to migrate to the new @serwist/next
:
// @ts-check
const withSerwist = require("@serwist/next").default({
cacheOnFrontEndNav: true,
swSrc: "app/sw.ts",
swDest: "public/sw.js",
});
/** @type {import("next").NextConfig} */
const nextConfig = {
reactStrictMode: true,
};
module.exports = withSerwist(nextConfig);
// @ts-check
/** @type {import("next").NextConfig} */
const nextConfig = {
reactStrictMode: true,
};
module.exports = async () => {
const withSerwist = (await import("@serwist/next")).default({
cacheOnFrontEndNav: true,
swSrc: "app/sw.ts",
swDest: "public/sw.js",
});
return withSerwist(nextConfig);
};
I know that most of our current userbase use Next.js, which still suggests using a CJS config file, so I am really sorry for the trouble I have caused for you :( However, what needs to be done has to be done. It was time to migrate and get rid of old, legacy things.
30e4c25
, defdd5a
]:
Published by github-actions[bot] 9 months ago
defdd5a
Thanks @DuCanhGH! - refactor(js): migrate to ESM-only
Serwist is now an ESM-only project.
This was done because our tooling around supporting CJS had always been crappy: it was slow, had no way of supporting emitting .d.cts
(we used to copy .d.ts
to .d.cts
), and was too error-prone (there were various issues of our builds crashing due to an ESM-only package slipping in).
If you already use ESM, there's nothing to be done. Great! Otherwise, to migrate:
Migrate to ESM if possible.
Otherwise, use dynamic imports. For example, to migrate to the new @serwist/next
:
// @ts-check
const withSerwist = require("@serwist/next").default({
cacheOnFrontEndNav: true,
swSrc: "app/sw.ts",
swDest: "public/sw.js",
});
/** @type {import("next").NextConfig} */
const nextConfig = {
reactStrictMode: true,
};
module.exports = withSerwist(nextConfig);
// @ts-check
/** @type {import("next").NextConfig} */
const nextConfig = {
reactStrictMode: true,
};
module.exports = async () => {
const withSerwist = (await import("@serwist/next")).default({
cacheOnFrontEndNav: true,
swSrc: "app/sw.ts",
swDest: "public/sw.js",
});
return withSerwist(nextConfig);
};
I know that most of our current userbase use Next.js, which still suggests using a CJS config file, so I am really sorry for the trouble I have caused for you :( However, what needs to be done has to be done. It was time to migrate and get rid of old, legacy things.
30e4c25
, defdd5a
]:
Published by github-actions[bot] 9 months ago
30e4c25
Thanks @DuCanhGH! - chore(next): renamed /browser to /worker
This new name makes more sense than the old one, for these exports are actually for use in service workers.
To migrate, simply change all imports of @serwist/next/browser
to those of @serwist/next/worker
:
import { defaultCache } from "@serwist/next/browser";
installSerwist({
// Other options
runtimeCaching: defaultCache,
});
import { defaultCache } from "@serwist/next/worker";
installSerwist({
// Other options
runtimeCaching: defaultCache,
});
30e4c25
Thanks @DuCanhGH! - chore(peerDeps): bump minimum supported TypeScript and Node.js version
# Change to your preferred way of updating Node.js
nvm use 18
# Change to your package manager
npm i -D typescript@5
defdd5a
Thanks @DuCanhGH! - refactor(js): migrate to ESM-only
Serwist is now an ESM-only project.
This was done because our tooling around supporting CJS had always been crappy: it was slow, had no way of supporting emitting .d.cts
(we used to copy .d.ts
to .d.cts
), and was too error-prone (there were various issues of our builds crashing due to an ESM-only package slipping in).
If you already use ESM, there's nothing to be done. Great! Otherwise, to migrate:
Migrate to ESM if possible.
Otherwise, use dynamic imports. For example, to migrate to the new @serwist/next
:
// @ts-check
const withSerwist = require("@serwist/next").default({
cacheOnFrontEndNav: true,
swSrc: "app/sw.ts",
swDest: "public/sw.js",
});
/** @type {import("next").NextConfig} */
const nextConfig = {
reactStrictMode: true,
};
module.exports = withSerwist(nextConfig);
// @ts-check
/** @type {import("next").NextConfig} */
const nextConfig = {
reactStrictMode: true,
};
module.exports = async () => {
const withSerwist = (await import("@serwist/next")).default({
cacheOnFrontEndNav: true,
swSrc: "app/sw.ts",
swDest: "public/sw.js",
});
return withSerwist(nextConfig);
};
I know that most of our current userbase use Next.js, which still suggests using a CJS config file, so I am really sorry for the trouble I have caused for you :( However, what needs to be done has to be done. It was time to migrate and get rid of old, legacy things.
30e4c25
Thanks @DuCanhGH! - feat(next): added @serwist/next/worker.definePageRuntimeCaching
runtimeCaching
entries in defaultCache
, which are "pages-rsc-prefetch"
, "pages-rsc"
, and "pages"
. However, if an user were to extend this runtimeCaching
array with their own pages entries, they would have to copy this from defaultCache
, requiring them to inspect the source code. This method was added so that the user can conveniently do the same without the hassle.defdd5a
, 30e4c25
, defdd5a
, 30e4c25
, 04d2619
]:
Published by github-actions[bot] 9 months ago
30e4c25
Thanks @DuCanhGH! - chore(peerDeps): bump minimum supported TypeScript and Node.js version
# Change to your preferred way of updating Node.js
nvm use 18
# Change to your package manager
npm i -D typescript@5
defdd5a
Thanks @DuCanhGH! - refactor(js): migrate to ESM-only
Serwist is now an ESM-only project.
This was done because our tooling around supporting CJS had always been crappy: it was slow, had no way of supporting emitting .d.cts
(we used to copy .d.ts
to .d.cts
), and was too error-prone (there were various issues of our builds crashing due to an ESM-only package slipping in).
If you already use ESM, there's nothing to be done. Great! Otherwise, to migrate:
Migrate to ESM if possible.
Otherwise, use dynamic imports. For example, to migrate to the new @serwist/next
:
// @ts-check
const withSerwist = require("@serwist/next").default({
cacheOnFrontEndNav: true,
swSrc: "app/sw.ts",
swDest: "public/sw.js",
});
/** @type {import("next").NextConfig} */
const nextConfig = {
reactStrictMode: true,
};
module.exports = withSerwist(nextConfig);
// @ts-check
/** @type {import("next").NextConfig} */
const nextConfig = {
reactStrictMode: true,
};
module.exports = async () => {
const withSerwist = (await import("@serwist/next")).default({
cacheOnFrontEndNav: true,
swSrc: "app/sw.ts",
swDest: "public/sw.js",
});
return withSerwist(nextConfig);
};
I know that most of our current userbase use Next.js, which still suggests using a CJS config file, so I am really sorry for the trouble I have caused for you :( However, what needs to be done has to be done. It was time to migrate and get rid of old, legacy things.
defdd5a
, 30e4c25
, defdd5a
]:
Published by github-actions[bot] 9 months ago
30e4c25
Thanks @DuCanhGH! - chore(peerDeps): bump minimum supported TypeScript and Node.js version
# Change to your preferred way of updating Node.js
nvm use 18
# Change to your package manager
npm i -D typescript@5
defdd5a
Thanks @DuCanhGH! - refactor(js): migrate to ESM-only
Serwist is now an ESM-only project.
This was done because our tooling around supporting CJS had always been crappy: it was slow, had no way of supporting emitting .d.cts
(we used to copy .d.ts
to .d.cts
), and was too error-prone (there were various issues of our builds crashing due to an ESM-only package slipping in).
If you already use ESM, there's nothing to be done. Great! Otherwise, to migrate:
Migrate to ESM if possible.
Otherwise, use dynamic imports. For example, to migrate to the new @serwist/next
:
// @ts-check
const withSerwist = require("@serwist/next").default({
cacheOnFrontEndNav: true,
swSrc: "app/sw.ts",
swDest: "public/sw.js",
});
/** @type {import("next").NextConfig} */
const nextConfig = {
reactStrictMode: true,
};
module.exports = withSerwist(nextConfig);
// @ts-check
/** @type {import("next").NextConfig} */
const nextConfig = {
reactStrictMode: true,
};
module.exports = async () => {
const withSerwist = (await import("@serwist/next")).default({
cacheOnFrontEndNav: true,
swSrc: "app/sw.ts",
swDest: "public/sw.js",
});
return withSerwist(nextConfig);
};
I know that most of our current userbase use Next.js, which still suggests using a CJS config file, so I am really sorry for the trouble I have caused for you :( However, what needs to be done has to be done. It was time to migrate and get rid of old, legacy things.
30e4c25
, defdd5a
]:
Published by github-actions[bot] 9 months ago
defdd5a
Thanks @DuCanhGH! - refactor(js): migrate to ESM-only
Serwist is now an ESM-only project.
This was done because our tooling around supporting CJS had always been crappy: it was slow, had no way of supporting emitting .d.cts
(we used to copy .d.ts
to .d.cts
), and was too error-prone (there were various issues of our builds crashing due to an ESM-only package slipping in).
If you already use ESM, there's nothing to be done. Great! Otherwise, to migrate:
Migrate to ESM if possible.
Otherwise, use dynamic imports. For example, to migrate to the new @serwist/next
:
// @ts-check
const withSerwist = require("@serwist/next").default({
cacheOnFrontEndNav: true,
swSrc: "app/sw.ts",
swDest: "public/sw.js",
});
/** @type {import("next").NextConfig} */
const nextConfig = {
reactStrictMode: true,
};
module.exports = withSerwist(nextConfig);
// @ts-check
/** @type {import("next").NextConfig} */
const nextConfig = {
reactStrictMode: true,
};
module.exports = async () => {
const withSerwist = (await import("@serwist/next")).default({
cacheOnFrontEndNav: true,
swSrc: "app/sw.ts",
swDest: "public/sw.js",
});
return withSerwist(nextConfig);
};
I know that most of our current userbase use Next.js, which still suggests using a CJS config file, so I am really sorry for the trouble I have caused for you :( However, what needs to be done has to be done. It was time to migrate and get rid of old, legacy things.
30e4c25
, defdd5a
]:
Published by github-actions[bot] 9 months ago
defdd5a
Thanks @DuCanhGH! - refactor(js): migrate to ESM-only
Serwist is now an ESM-only project.
This was done because our tooling around supporting CJS had always been crappy: it was slow, had no way of supporting emitting .d.cts
(we used to copy .d.ts
to .d.cts
), and was too error-prone (there were various issues of our builds crashing due to an ESM-only package slipping in).
If you already use ESM, there's nothing to be done. Great! Otherwise, to migrate:
Migrate to ESM if possible.
Otherwise, use dynamic imports. For example, to migrate to the new @serwist/next
:
// @ts-check
const withSerwist = require("@serwist/next").default({
cacheOnFrontEndNav: true,
swSrc: "app/sw.ts",
swDest: "public/sw.js",
});
/** @type {import("next").NextConfig} */
const nextConfig = {
reactStrictMode: true,
};
module.exports = withSerwist(nextConfig);
// @ts-check
/** @type {import("next").NextConfig} */
const nextConfig = {
reactStrictMode: true,
};
module.exports = async () => {
const withSerwist = (await import("@serwist/next")).default({
cacheOnFrontEndNav: true,
swSrc: "app/sw.ts",
swDest: "public/sw.js",
});
return withSerwist(nextConfig);
};
I know that most of our current userbase use Next.js, which still suggests using a CJS config file, so I am really sorry for the trouble I have caused for you :( However, what needs to be done has to be done. It was time to migrate and get rid of old, legacy things.
30e4c25
, defdd5a
]: