Jal*_*lle 15 typescript webpack package.json angular-cli angular
这是我的Angular5项目结构.
双方tsconfig.app.json并package.json包含这部分
"include": [
"/src/main.ts",
"/src/polyfills.ts"
]
Run Code Online (Sandbox Code Playgroud)
但无论我尝试什么,我仍然会收到此错误:
\polyfills.ts & \main.ts is missing from the TypeScript compilation.
Please make sure it is in your tsconfig via the 'files' or 'include' property.
Run Code Online (Sandbox Code Playgroud)
tsconfig.json
{
"compileOnSave": false,
"compilerOptions": {
"outDir": "./dist/out-tsc",
"sourceMap": true,
"declaration": false,
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"target": "es5",
"typeRoots": [
"node_modules/@types"
],
"lib": [
"es2017",
"dom"
]
}
}
src/tsconfig.app.json
{
"extends": "../tsconfig.json",
"compilerOptions": {
"outDir": "../out-tsc/app",
"baseUrl": "./",
"module": "es2015",
"types": []
},
"include": [
"main.ts",
"polyfills.ts"
],
"exclude": [
"test.ts",
"**/*.spec.ts"
]
}
Run Code Online (Sandbox Code Playgroud)
LFe*_*lix 11
找到了解决方案.问题是因为我在符号链接目录($ HOME/dev - > d:\ dev \)中移动到原始目录(d:\ dev)并运行命令并且它可以工作.
资料来源:https://github.com/angular/angular-cli/issues/9909
小智 6
编辑angular.json以在节点下添加以下属性projects/project/architect/build/options应该有助于"preserveSymlinks": true工作。
use*_*994 -1
这可能是因为您使用的是绝对路径。
尝试更改:
"/src/main.ts",
Run Code Online (Sandbox Code Playgroud)
到
"src/main.ts",
Run Code Online (Sandbox Code Playgroud)
(或者可能只是"main.ts")
| 归档时间: |
|
| 查看次数: |
7718 次 |
| 最近记录: |