Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,8 @@ jobs:
- name: Test
run: pnpm test

- name: Build
run: pnpm --filter @learnpro/web build

- name: Format check
run: pnpm format:check
19 changes: 18 additions & 1 deletion apps/web/next.config.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,25 @@
import type { NextConfig } from "next";

// Workspace packages whose source ships as TypeScript with NodeNext-style `.js` relative
// imports must be listed here so Next.js's webpack pass runs them through SWC. Add a package
// the moment apps/web imports from it.
//
// `transpilePackages` alone isn't sufficient when the source uses `.js` extensions on relative
// imports (NodeNext convention) — webpack's resolver still won't follow `.js` to a `.ts` file.
// `extensionAlias` tells webpack: when you see `import './foo.js'`, also try `./foo.ts` and
// `./foo.tsx`. Standard fix for NodeNext-style ESM under webpack.
const nextConfig: NextConfig = {
reactStrictMode: true,
transpilePackages: ["@learnpro/shared"],
transpilePackages: ["@learnpro/shared", "@learnpro/sandbox"],
webpack: (config) => {
config.resolve = config.resolve ?? {};
config.resolve.extensionAlias = {
...(config.resolve.extensionAlias ?? {}),
".js": [".ts", ".tsx", ".js"],
".mjs": [".mts", ".mjs"],
};
return config;
},
};

export default nextConfig;
Loading