将选项传递给流星上的JS编译器
我们将jsconfig
文件添加到流星项目的根部,以添加短双手形式导入。
例如,而不是从'../../ api/users/stutations'导入usermutations';
我们想从'@api/users/stumations';
这是一个示例JSCONFIG文件
{
"compilerOptions": {
"baseUrl": ".",
"paths": {
"@api/*": ["api/*"],
}
}
}
时,我们将其添加到npm
backages时,我们的短手导入了丢失。
任何帮助都将受到赞赏
We are adding a jsconfig
file to the root of a meteor project to add short hands form imports.
For instance instead of import UserMutations from '../../api/Users/mutations';
we would like to write import UserMutations from '@api/Users/mutations';
This is an example jsconfig file
{
"compilerOptions": {
"baseUrl": ".",
"paths": {
"@api/*": ["api/*"],
}
}
}
When we add this our short hand imports recognized as npm
packages that are missing.
Any help is appreciated
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
看起来您指的是
https://guide.meteor.com/build-tool.build-tool.htool.html.html#typescript 。因此,您的文件
需要称为
tsconfig.json
。Looks like what you are referring to is
https://guide.meteor.com/build-tool.html#typescript. Accordingly, your file
needs to be called
tsconfig.json
.流星的构建系统在引擎盖下使用Babel。因此,您可以使用插件的“模块 - 溶液剂”来解决任务:
安装NPM软件包:
create .babelrc 在您的流星项目的根源:
然后导入
Meteor's build system uses babel under the hood. So, you can solve your task with a plugin 'module-resolver':
Install npm package:
Create .babelrc at the root of your meteor project:
Then import