私は会社全体のさまざまなWebプロジェクトで使用するためにUIコンポーネントを開発しています。私たちはローカルリポジトリにnpmパッケージとしてui-componentsを公開したいと思っています。パッケージworks fineを公開しています。UIコンポーネントを角型でエクスポートする - テンプレートが見つかりません
パッケージをインストールするときは、app.module.ts
にモジュールをインポートし、 'ng serve'(Angular CLI Project)を実行してください。すべてがうまくコンパイルされます。ローカルホスト上のサイトにアクセスするときしかし、何も示されていないと、コンソールは述べていますされています
はなぜ角度は、それらがコンパイルされ、パッケージ化されている場合、HTML形式のテンプレートを探していますか?これらのコンポーネントが既にコンパイルされていることをCLIに伝える方法はありますか?
{
"compilerOptions": {
"baseUrl": ".",
"declaration": true,
"stripInternal": true,
"experimentalDecorators": true,
"emitDecoratorMetadata": true,
"strictNullChecks": true,
"noImplicitAny": true,
"module": "es2015",
"moduleResolution": "node",
"paths": {
"@angular/core": ["node_modules/@angular/core"],
"@angular/common": ["node_modules/@angular/common"],
"@angular/forms": ["node_modules/@angular/forms"],
"@ng-bootstrap/ng-bootstrap": ["node_modules/@ng-bootstrap/ng-bootstrap"]
},
"rootDir": ".",
"outDir": "dist",
"sourceMap": true,
"inlineSources": true,
"target": "es5",
"skipLibCheck": true,
"lib": [
"es2015",
"dom"
]
},
"files": [
"index.ts"
],
"angularCompilerOptions": {
"strictMetadataEmit": true
}
}
は、私はインターネット上でangularCompilerOptionsためのドキュメントを見つけることができませんでした(梱包前)
tsconfig.json ...
NPMパッケージnode_modules
の場合:
私はbutton.component.ngfactory.js
でCSS-クラスを検索することにより、ボタン・テンプレートが見つかりましたが、エクスポートButtonComponentNgFactory
はどこにも輸入しないことのようです。