Skip to content

Commit c61f9bc

Browse files
committed
fix: transpile @antfu/design in the Next hub build
Next/Turbopack has no loader for the bare .ts source @antfu/design ships (utils/iconify.ts, now imported by design/dock-icon.ts) and fails the production build with "Unknown module type". Add it to transpilePackages so Next runs the package through its own transform, matching how Vite already handles it.
1 parent e6cb0db commit c61f9bc

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

‎examples/minimal-next-devframe-hub/src/client/next.config.mjs‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
/** @type {import('next').NextConfig} */
22
const nextConfig = {
33
images: { unoptimized: true },
4+
// @antfu/design ships raw, uncompiled `.ts`/`.vue` source (see its README —
5+
// "no bundling, your build compiles it"). `dockIconSvg` (design/dock-icon.ts)
6+
// imports its `utils/iconify.ts` directly, so Next/Turbopack — which
7+
// otherwise treats node_modules as pre-built and has no loader for a bare
8+
// `.ts` file there — needs to run this package through its own transform.
9+
transpilePackages: ['@antfu/design'],
410
// The workspace typecheck owns source-level project references.
511
typescript: { ignoreBuildErrors: true },
612
// Mounted devframe SPAs are served at `/__<id>/` and reference their assets

0 commit comments

Comments
 (0)