在可构建库目录下,创建一个名为'tsconfig.lib.json”的新文件,并将以下代码添加到该文件中:
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"outDir": "../../dist/out-tsc",
"types": []
},
"angularCompilerOptions": {
"enableIvy": false,
"preserveSymlinks": true
},
"exclude": [
"**/*.spec.ts",
"**/*.mock.ts",
"**/*.stories.ts"
]
}
确保其中'angularCompilerOptions”下的'preserveSymlinks”为true,然后重新构建该库,HTML文件应该被正确编译。