mirror of
https://github.com/hanzo-apps/tabs.git
synced 2026-09-15 19:32:29 +00:00
`next build --webpack` stopped at react-native-svg asking for @react-native/assets-registry/registry; the web registry lives in react-native-web, so the alias points there and the gui packages are transpiled. The server renders @hanzo/ui through its node entry, which imports no CSS, so the export shipped without the sheet and the page drew as bare HTML. The root layout imports @hanzo/ui/styles.css, and the Zen faces from @hanzo/design, so tokens, themes and component rules reach every page. The typecheck runs before a build creates next-env.d.ts, so *.css imports are declared for TypeScript 7. tsconfig carries the two values Next writes on every build. The install stops on no prompt: both jest build scripts are answered. Co-authored-by: Hanzo Dev <[email protected]>
36 lines
1.5 KiB
JavaScript
36 lines
1.5 KiB
JavaScript
/** @type {import('next').NextConfig} */
|
|
export default {
|
|
reactStrictMode: true,
|
|
// A STATIC EXPORT. Tabs has no backend by design: it reads the control plane
|
|
// from the browser with the caller's own IAM token and frames terminals the
|
|
// machines themselves serve. With nothing to run at request time, a server
|
|
// would only be something else to keep up.
|
|
output: 'export',
|
|
trailingSlash: true,
|
|
images: { unoptimized: true },
|
|
// The gui packages ship untranspiled ESM resolved against react-native.
|
|
transpilePackages: ['@hanzo/gui', '@hanzo/ui', 'react-native-web'],
|
|
// @hanzo/ui renders through @hanzo/gui, which is React Native's component
|
|
// model. On web `react-native` IS `react-native-web`, and the packages that
|
|
// reach for the former (@hanzogui/sheet, the icon set's svg backend) resolve
|
|
// to real React Native without this — a Flow-typed source webpack cannot
|
|
// parse. The `.web.*` extensions are the other half: a package that ships a
|
|
// web variant beside its native one is asking to be chosen by extension.
|
|
webpack(config) {
|
|
config.resolve.alias = {
|
|
...config.resolve.alias,
|
|
'react-native$': 'react-native-web',
|
|
// react-native-svg reads the asset registry; the web one lives here.
|
|
'@react-native/assets-registry/registry': 'react-native-web/dist/modules/AssetRegistry',
|
|
};
|
|
config.resolve.extensions = [
|
|
'.web.tsx',
|
|
'.web.ts',
|
|
'.web.jsx',
|
|
'.web.js',
|
|
...config.resolve.extensions,
|
|
];
|
|
return config;
|
|
},
|
|
};
|