目标
所以我有一个具有这种结构的项目:
目的是在shared模块中定义公共接口和类。
限制条件
我不想将代码上传到npm以便在本地使用它,也根本不打算上传代码。它应该100%脱机工作。
虽然开发过程应该脱机工作,但是ionic-app和firebase-functions模块将部署到Firebase(托管和功能)。因此,shared模块的代码应该在那里可用。
到目前为止我尝试过的
Function failed on loading user code. Error message: Code in file lib/index.js can't be loaded.
Did you list all required modules in the package.json dependencies?
Detailed stack trace: Error: Cannot find module 'shared'
at Function.Module._resolveFilename (module.js:548:15)
at Function.Module._load (module.js:475:25)
at Module.require (module.js:597:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (/srv/lib/index.js:5:18)
Run Code Online (Sandbox Code Playgroud)
题
您是否有使用打字稿配置或NPM制作共享模块的解决方案?
请不要将此标记为重复项?我已经尝试过在StackOverflow上找到的任何解决方案。
附加信息 …