typescript - Next.js 自定义打字稿服务器
问题描述
我有一个带有两个 next.js 应用程序的 monorepo。以及这两个应用程序的通用库。我需要自定义服务器来处理语言环境路由。执行自定义服务器并使用 ts-node 运行,例如:https ://github.com/vercel/next.js/tree/canary/examples/custom-server-typescript
但无法在 next.js 应用程序之外导入 smth 并出现错误:
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file
如何创建自定义服务器并在 next.js 目录之外导入一些打字稿模块?
解决方案
推荐阅读
- cordova - 覆盖 CapacitorWebView 上的 shouldOverrideUrlLoading 和 onPageFinished
- ios - 在不中断背景媒体播放的情况下录制音频
- node.js - JSON.parse() 导致没有任何数据的错误
- python-3.x - Python中的多元线性回归机器学习
- android - Android VOIP 应用程序
- asp.net-core-2.2 - AspNet 核心 401 - 添加令牌时没有 SecurityTokenValidator
- git - 如何分叉和修改 Google API Go 客户端 SDK 以解决 Slides API Range 问题?
- php - woocommerce 自定义电子邮件模板 php
- localhost - 从 iPhone 访问本地主机 - WAMP
- javascript - 如何在 Angular 中保存组件的状态?