使用NX(TSC)转移时,如何删除SRC文件夹(平坦)?
我在此处使用NX进行了一个LIB项目: https://github.com/geofmigliacci/magnetarise 所以我可以跨性&我得到的DIST文件夹是这样的:
dist/core/src
事实是,当我打包项目并安装它时,当我想导入时,我会得到类似的导入:
import { XService } from '@magnetarise/src/services';
但是我想进行类似的导入:
import { XService } from '@magnetarise/services'; (not everything inside @magnetarise)
因此请删除SRC文件夹;我已经看了看保持SRC /文件夹结构在使用Typescript 3 &试图在我的packages/core/tsconfig.lib.json
内将rootdir设置为“ src”,但它不起作用。
有人有这个问题吗?知道如何解决吗?
谢谢您的阅读。
I made a lib project using NX here : https://github.com/geofmigliacci/magnetarise so I can transpile & I get my dist folder like so :
dist/core/src
The thing is that when I pack my project and install it, when I want to import I get an import like so :
import { XService } from '@magnetarise/src/services';
But I'd like to have an import like :
import { XService } from '@magnetarise/services'; (not everything inside @magnetarise)
So removing the src folder ; I already took a look at Maintain src/ folder structure when building to dist/ folder with TypeScript 3 & tried to set the rootDir to "src" inside my packages/core/tsconfig.lib.json
but it doesn't work.
Has anyone got this problem & know how to solve it ?
Thank you for reading.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
需要
rootdir
内部options
of project.json文件https://nx.dev/packages/js/executors/tsc#rootdir
Need to
rootDir
insideoptions
of project.json filehttps://nx.dev/packages/js/executors/tsc#rootdir