- Install @myriaddreamin/typst.ts package for WebAssembly Typst rendering - Create server-side API endpoints for template loading and SVG generation - Implement TypstSoroban React component with error handling and loading states - Add test page for verifying typst.ts integration - Configure webpack for WASM support and resolve browser compatibility 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
34 lines
795 B
JavaScript
34 lines
795 B
JavaScript
/** @type {import('next').NextConfig} */
|
|
const nextConfig = {
|
|
experimental: {
|
|
optimizePackageImports: ['@soroban/core', '@soroban/client'],
|
|
serverComponentsExternalPackages: ['@myriaddreamin/typst.ts'],
|
|
},
|
|
transpilePackages: ['@soroban/core', '@soroban/client'],
|
|
webpack: (config, { isServer }) => {
|
|
config.experiments = {
|
|
...config.experiments,
|
|
asyncWebAssembly: true,
|
|
layers: true,
|
|
}
|
|
|
|
// Fix for WASM modules
|
|
config.module.rules.push({
|
|
test: /\.wasm$/,
|
|
type: 'asset/resource',
|
|
})
|
|
|
|
// Handle typst.ts WASM files specifically
|
|
if (!isServer) {
|
|
config.resolve.fallback = {
|
|
...config.resolve.fallback,
|
|
fs: false,
|
|
path: false,
|
|
}
|
|
}
|
|
|
|
return config
|
|
},
|
|
}
|
|
|
|
module.exports = nextConfig |