小编Eko*_*oar的帖子

jest 无法解析模块别名

我正在使用一个名为 module-alias 的 npm 模块。我在 tsconfig.json 和 package.json 中映射一些模块

\n\n

tsconfig.json

\n\n
"compilerOptions": {\n   "baseUrl": "./src",\n   "paths": {\n   "@config/*": ["config/*"],\n   "@interfaces/*": ["interfaces/*"],\n   "@services/*": ["services/*"]\n  },\n  "module": "commonjs",\n  "target": "es2015",                   /* Specify module code generation: \'none\', \'commonjs\', \'amd\', \'system\', \'umd\', \'es2015\', or \'ESNext\'. */\n  "sourceMap": true,\n  "outDir": "./dist",                        /* Redirect output structure to the directory. */\n  "rootDir": "./src",    \n  "allowSyntheticDefaultImports": true          /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */\n}\n
Run Code Online (Sandbox Code Playgroud)\n\n

包.json …

alias unit-testing node.js typescript jestjs

13
推荐指数
2
解决办法
2万
查看次数

angular2快速入门找不到名称“模块”

我正在遵循《英雄之旅》教程来构建我的第一个应用程序,我编写了一个组件文件threads.component.ts,如下所示:

@Component({
    moduleId: module.id,
    selector: 'Threads',
    templateUrl: './threads.component.html',
    styleUrls: ['./threads.component.css']
})
Run Code Online (Sandbox Code Playgroud)

但出现错误“找不到名称模块”,该怎么办才能解决此问题?

angularjs typescript

2
推荐指数
1
解决办法
3121
查看次数

标签 统计

typescript ×2

alias ×1

angularjs ×1

jestjs ×1

node.js ×1

unit-testing ×1