В целом у меня есть несколько проектов, с которыми я хочу поделиться компонентами.Мне нужно, чтобы разработка была быстрой, и если я создаю проект библиотеки, то мне нужно собирать и развертывать каждую библиотеку всякий раз, когда она меняется ... поэтому я решил просто создать каталог с общими компонентами в нем и динамически связать компоненты спроект.
Я нахожусь на MacOS Mojave 10.14 с NodeJS v10.12.0 и angular cli v7.0.2
Моя папка src/app
имеет следующее:
16 -rw-r--r-- 1 zoharzz staff 792 Oct 20 19:21 app-routing.module.ts
16 -rw-r--r-- 1 zoharzz staff 1173 Oct 20 19:02 app.component.html
0 -rw-r--r-- 1 zoharzz staff 0 Oct 20 19:02 app.component.scss
16 -rw-r--r-- 1 zoharzz staff 1113 Oct 20 19:02 app.component.spec.ts
16 -rw-r--r-- 1 zoharzz staff 222 Oct 20 19:02 app.component.ts
16 -rw-r--r-- 1 zoharzz staff 1508 Oct 20 20:19 app.module.ts
0 drwxr-xr-x 6 zoharzz staff 204 Oct 20 19:34 car-n-details-dialog
0 drwxr-xr-x 6 zoharzz staff 204 Oct 20 19:34 footer-toolbar
16 -rw-r--r-- 1 zoharzz staff 647 Oct 20 19:58 graphql.module.ts
0 drwxr-xr-x 6 zoharzz staff 204 Oct 20 19:34 home
0 drwxr-xr-x 6 zoharzz staff 204 Oct 20 19:34 products
0 drwxr-xr-x 6 zoharzz staff 204 Oct 15 16:14 terms-page
0 drwxr-xr-x 6 zoharzz staff 204 Oct 20 19:39 toolbar
16 lrwxr-xr-x 1 zoharzz staff 45 Oct 20 20:22 tuxin-ec-accessibility -> ../../../tuxin-ec-libs/tuxin-ec-accessibility
16 lrwxr-xr-x 1 zoharzz staff 43 Oct 20 19:13 tuxin-ec-breadcrumbs -> ../../../tuxin-ec-libs/tuxin-ec-breadcrumbs
16 lrwxr-xr-x 1 zoharzz staff 36 Oct 20 19:13 tuxin-ec-cars -> ../../../tuxin-ec-libs/tuxin-ec-cars
16 lrwxr-xr-x 1 zoharzz staff 36 Oct 20 19:13 tuxin-ec-cart -> ../../../tuxin-ec-libs/tuxin-ec-cart
16 lrwxr-xr-x 1 zoharzz staff 42 Oct 20 19:13 tuxin-ec-contact-us -> ../../../tuxin-ec-libs/tuxin-ec-contact-us
0 drwxr-xr-x 3 zoharzz staff 102 Oct 20 20:18 tuxin-ec-libs
16 lrwxr-xr-x 1 zoharzz staff 48 Oct 20 19:35 tuxin-ec-login-management -> ../../../tuxin-ec-libs/tuxin-ec-login-management
16 lrwxr-xr-x 1 zoharzz staff 39 Oct 20 19:13 tuxin-ec-payment -> ../../../tuxin-ec-libs/tuxin-ec-payment
16 lrwxr-xr-x 1 zoharzz staff 39 Oct 20 19:13 tuxin-ec-product -> ../../../tuxin-ec-libs/tuxin-ec-product
16 lrwxr-xr-x 1 zoharzz staff 42 Oct 20 19:13 tuxin-ec-validators -> ../../../tuxin-ec-libs/tuxin-ec-validators
поэтому, когда я пытаюсь скомпилировать его с помощью ng build -c development
, я получаю:
ERROR in ../tuxin-ec-libs/tuxin-ec-accessibility/tuxin-ec-accessibility.component.ts
Module build failed (from ./node_modules/@ngtools/webpack/src/index.js):
Error: /Volumes/osx-storage/projects/wd/tuxin-ec-libs/tuxin-ec-accessibility/tuxin-ec-accessibility.component.ts is missing from the TypeScript compilation. Please make sure it is in your tsconfig via the 'files' or 'include' property.
at AngularCompilerPlugin.getCompiledFile (/Volumes/osx-storage/projects/wd/windy-client/node_modules/@ngtools/webpack/src/angular_compiler_plugin.js:762:23)
at plugin.done.then (/Volumes/osx-storage/projects/wd/windy-client/node_modules/@ngtools/webpack/src/loader.js:41:31)
at process._tickCallback (internal/process/next_tick.js:68:7)
ERROR in ../tuxin-ec-libs/tuxin-ec-breadcrumbs/tuxin-ec-breadcrumbs.component.ts
Module build failed (from ./node_modules/@ngtools/webpack/src/index.js):
Error: /Volumes/osx-storage/projects/wd/tuxin-ec-libs/tuxin-ec-breadcrumbs/tuxin-ec-breadcrumbs.component.ts is missing from the TypeScript compilation. Please make sure it is in your tsconfig via the 'files' or 'include' property.
at AngularCompilerPlugin.getCompiledFile (/Volumes/osx-storage/projects/wd/windy-client/node_modules/@ngtools/webpack/src/angular_compiler_plugin.js:762:23)
at plugin.done.then (/Volumes/osx-storage/projects/wd/windy-client/node_modules/@ngtools/webpack/src/loader.js:41:31)
at process._tickCallback (internal/process/next_tick.js:68:7)
ERROR in ../tuxin-ec-libs/tuxin-ec-cars/car-type/tuxin-ec-car-type.component.ts
Module build failed (from ./node_modules/@ngtools/webpack/src/index.js):
Error: /Volumes/osx-storage/projects/wd/tuxin-ec-libs/tuxin-ec-cars/car-type/tuxin-ec-car-type.component.ts is missing from the TypeScript compilation. Please make sure it is in your tsconfig via the 'files' or 'include' property.
at AngularCompilerPlugin.getCompiledFile (/Volumes/osx-storage/projects/wd/windy-client/node_modules/@ngtools/webpack/src/angular_compiler_plugin.js:762:23)
at plugin.done.then (/Volumes/osx-storage/projects/wd/windy-client/node_modules/@ngtools/webpack/src/loader.js:41:31)
at process._tickCallback (internal/process/next_tick.js:68:7)
ERROR in ../tuxin-ec-libs/tuxin-ec-cart/cart-page/tuxin-ec-cart-page.component.ts
Module build failed (from ./node_modules/@ngtools/webpack/src/index.js):
Error: /Volumes/osx-storage/projects/wd/tuxin-ec-libs/tuxin-ec-cart/cart-page/tuxin-ec-cart-page.component.ts is missing from the TypeScript compilation. Please make sure it is in your tsconfig via the 'files' or 'include' property.
at AngularCompilerPlugin.getCompiledFile (/Volumes/osx-storage/projects/wd/windy-client/node_modules/@ngtools/webpack/src/angular_compiler_plugin.js:762:23)
at plugin.done.then (/Volumes/osx-storage/projects/wd/windy-client/node_modules/@ngtools/webpack/src/loader.js:41:31)
at process._tickCallback (internal/process/next_tick.js:68:7)
ERROR in ../tuxin-ec-libs/tuxin-ec-cart/delivery-options/tuxin-ec-delivery-options.component.ts
Module build failed (from ./node_modules/@ngtools/webpack/src/index.js):
Error: /Volumes/osx-storage/projects/wd/tuxin-ec-libs/tuxin-ec-cart/delivery-options/tuxin-ec-delivery-options.component.ts is missing from the TypeScript compilation. Please make sure it is in your tsconfig via the 'files' or 'include' property.
at AngularCompilerPlugin.getCompiledFile (/Volumes/osx-storage/projects/wd/windy-client/node_modules/@ngtools/webpack/src/angular_compiler_plugin.js:762:23)
at plugin.done.then (/Volumes/osx-storage/projects/wd/windy-client/node_modules/@ngtools/webpack/src/loader.js:41:31)
at process._tickCallback (internal/process/next_tick.js:68:7)
ERROR in ../tuxin-ec-libs/tuxin-ec-cart/invoice/tuxin-ec-invoice.component.ts
Module build failed (from ./node_modules/@ngtools/webpack/src/index.js):
Error: /Volumes/osx-storage/projects/wd/tuxin-ec-libs/tuxin-ec-cart/invoice/tuxin-ec-invoice.component.ts is missing from the TypeScript compilation. Please make sure it is in your tsconfig via the 'files' or 'include' property.
at AngularCompilerPlugin.getCompiledFile (/Volumes/osx-storage/projects/wd/windy-client/node_modules/@ngtools/webpack/src/angular_compiler_plugin.js:762:23)
at plugin.done.then (/Volumes/osx-storage/projects/wd/windy-client/node_modules/@ngtools/webpack/src/loader.js:41:31)
at process._tickCallback (internal/process/next_tick.js:68:7)
ERROR in ../tuxin-ec-libs/tuxin-ec-cart/side-cart/tuxin-ec-side-cart.component.ts
Module build failed (from ./node_modules/@ngtools/webpack/src/index.js):
Error: /Volumes/osx-storage/projects/wd/tuxin-ec-libs/tuxin-ec-cart/side-cart/tuxin-ec-side-cart.component.ts is missing from the TypeScript compilation. Please make sure it is in your tsconfig via the 'files' or 'include' property.
at AngularCompilerPlugin.getCompiledFile (/Volumes/osx-storage/projects/wd/windy-client/node_modules/@ngtools/webpack/src/angular_compiler_plugin.js:762:23)
at plugin.done.then (/Volumes/osx-storage/projects/wd/windy-client/node_modules/@ngtools/webpack/src/loader.js:41:31)
at process._tickCallback (internal/process/next_tick.js:68:7)
ERROR in ../tuxin-ec-libs/tuxin-ec-cart/tuxin-ec-cart.service.ts
Module build failed (from ./node_modules/@ngtools/webpack/src/index.js):
Error: /Volumes/osx-storage/projects/wd/tuxin-ec-libs/tuxin-ec-cart/tuxin-ec-cart.service.ts is missing from the TypeScript compilation. Please make sure it is in your tsconfig via the 'files' or 'include' property.
at AngularCompilerPlugin.getCompiledFile (/Volumes/osx-storage/projects/wd/windy-client/node_modules/@ngtools/webpack/src/angular_compiler_plugin.js:762:23)
at plugin.done.then (/Volumes/osx-storage/projects/wd/windy-client/node_modules/@ngtools/webpack/src/loader.js:41:31)
at process._tickCallback (internal/process/next_tick.js:68:7)
ERROR in ../tuxin-ec-libs/tuxin-ec-contact-us/tuxin-ec-contact-us-graphql.service.ts
Module build failed (from ./node_modules/@ngtools/webpack/src/index.js):
Error: /Volumes/osx-storage/projects/wd/tuxin-ec-libs/tuxin-ec-contact-us/tuxin-ec-contact-us-graphql.service.ts is missing from the TypeScript compilation. Please make sure it is in your tsconfig via the 'files' or 'include' property.
at AngularCompilerPlugin.getCompiledFile (/Volumes/osx-storage/projects/wd/windy-client/node_modules/@ngtools/webpack/src/angular_compiler_plugin.js:762:23)
at plugin.done.then (/Volumes/osx-storage/projects/wd/windy-client/node_modules/@ngtools/webpack/src/loader.js:41:31)
at process._tickCallback (internal/process/next_tick.js:68:7)
ERROR in ../tuxin-ec-libs/tuxin-ec-contact-us/tuxin-ec-contact-us.component.ts
Module build failed (from ./node_modules/@ngtools/webpack/src/index.js):
Error: /Volumes/osx-storage/projects/wd/tuxin-ec-libs/tuxin-ec-contact-us/tuxin-ec-contact-us.component.ts is missing from the TypeScript compilation. Please make sure it is in your tsconfig via the 'files' or 'include' property.
at AngularCompilerPlugin.getCompiledFile (/Volumes/osx-storage/projects/wd/windy-client/node_modules/@ngtools/webpack/src/angular_compiler_plugin.js:762:23)
at plugin.done.then (/Volumes/osx-storage/projects/wd/windy-client/node_modules/@ngtools/webpack/src/loader.js:41:31)
at process._tickCallback (internal/process/next_tick.js:68:7)
ERROR in ../tuxin-ec-libs/tuxin-ec-login-management/login/tuxin-ec-login.component.ts
Module build failed (from ./node_modules/@ngtools/webpack/src/index.js):
Error: /Volumes/osx-storage/projects/wd/tuxin-ec-libs/tuxin-ec-login-management/login/tuxin-ec-login.component.ts is missing from the TypeScript compilation. Please make sure it is in your tsconfig via the 'files' or 'include' property.
at AngularCompilerPlugin.getCompiledFile (/Volumes/osx-storage/projects/wd/windy-client/node_modules/@ngtools/webpack/src/angular_compiler_plugin.js:762:23)
at plugin.done.then (/Volumes/osx-storage/projects/wd/windy-client/node_modules/@ngtools/webpack/src/loader.js:41:31)
at process._tickCallback (internal/process/next_tick.js:68:7)
ERROR in ../tuxin-ec-libs/tuxin-ec-login-management/tuxin-ec-user.service.ts
Module build failed (from ./node_modules/@ngtools/webpack/src/index.js):
Error: /Volumes/osx-storage/projects/wd/tuxin-ec-libs/tuxin-ec-login-management/tuxin-ec-user.service.ts is missing from the TypeScript compilation. Please make sure it is in your tsconfig via the 'files' or 'include' property.
at AngularCompilerPlugin.getCompiledFile (/Volumes/osx-storage/projects/wd/windy-client/node_modules/@ngtools/webpack/src/angular_compiler_plugin.js:762:23)
at plugin.done.then (/Volumes/osx-storage/projects/wd/windy-client/node_modules/@ngtools/webpack/src/loader.js:41:31)
at process._tickCallback (internal/process/next_tick.js:68:7)
ERROR in ../tuxin-ec-libs/tuxin-ec-payment/credit-card/tuxin-ec-credit-card.component.ts
Module build failed (from ./node_modules/@ngtools/webpack/src/index.js):
Error: /Volumes/osx-storage/projects/wd/tuxin-ec-libs/tuxin-ec-payment/credit-card/tuxin-ec-credit-card.component.ts is missing from the TypeScript compilation. Please make sure it is in your tsconfig via the 'files' or 'include' property.
at AngularCompilerPlugin.getCompiledFile (/Volumes/osx-storage/projects/wd/windy-client/node_modules/@ngtools/webpack/src/angular_compiler_plugin.js:762:23)
at plugin.done.then (/Volumes/osx-storage/projects/wd/windy-client/node_modules/@ngtools/webpack/src/loader.js:41:31)
at process._tickCallback (internal/process/next_tick.js:68:7)
ERROR in ../tuxin-ec-libs/tuxin-ec-payment/tuxin-ec-payment.component.ts
Module build failed (from ./node_modules/@ngtools/webpack/src/index.js):
Error: /Volumes/osx-storage/projects/wd/tuxin-ec-libs/tuxin-ec-payment/tuxin-ec-payment.component.ts is missing from the TypeScript compilation. Please make sure it is in your tsconfig via the 'files' or 'include' property.
at AngularCompilerPlugin.getCompiledFile (/Volumes/osx-storage/projects/wd/windy-client/node_modules/@ngtools/webpack/src/angular_compiler_plugin.js:762:23)
at plugin.done.then (/Volumes/osx-storage/projects/wd/windy-client/node_modules/@ngtools/webpack/src/loader.js:41:31)
at process._tickCallback (internal/process/next_tick.js:68:7)
ERROR in ../tuxin-ec-libs/tuxin-ec-product/hot-products/tuxin-ec-hot-products.component.ts
Module build failed (from ./node_modules/@ngtools/webpack/src/index.js):
Error: /Volumes/osx-storage/projects/wd/tuxin-ec-libs/tuxin-ec-product/hot-products/tuxin-ec-hot-products.component.ts is missing from the TypeScript compilation. Please make sure it is in your tsconfig via the 'files' or 'include' property.
at AngularCompilerPlugin.getCompiledFile (/Volumes/osx-storage/projects/wd/windy-client/node_modules/@ngtools/webpack/src/angular_compiler_plugin.js:762:23)
at plugin.done.then (/Volumes/osx-storage/projects/wd/windy-client/node_modules/@ngtools/webpack/src/loader.js:41:31)
at process._tickCallback (internal/process/next_tick.js:68:7)
ERROR in ../tuxin-ec-libs/tuxin-ec-product/product-card/tuxin-ec-product-card.component.ts
Module build failed (from ./node_modules/@ngtools/webpack/src/index.js):
Error: /Volumes/osx-storage/projects/wd/tuxin-ec-libs/tuxin-ec-product/product-card/tuxin-ec-product-card.component.ts is missing from the TypeScript compilation. Please make sure it is in your tsconfig via the 'files' or 'include' property.
at AngularCompilerPlugin.getCompiledFile (/Volumes/osx-storage/projects/wd/windy-client/node_modules/@ngtools/webpack/src/angular_compiler_plugin.js:762:23)
at plugin.done.then (/Volumes/osx-storage/projects/wd/windy-client/node_modules/@ngtools/webpack/src/loader.js:41:31)
at process._tickCallback (internal/process/next_tick.js:68:7)
ERROR in ../tuxin-ec-libs/tuxin-ec-product/tuxin-ec-category.service.ts
Module build failed (from ./node_modules/@ngtools/webpack/src/index.js):
Error: /Volumes/osx-storage/projects/wd/tuxin-ec-libs/tuxin-ec-product/tuxin-ec-category.service.ts is missing from the TypeScript compilation. Please make sure it is in your tsconfig via the 'files' or 'include' property.
at AngularCompilerPlugin.getCompiledFile (/Volumes/osx-storage/projects/wd/windy-client/node_modules/@ngtools/webpack/src/angular_compiler_plugin.js:762:23)
at plugin.done.then (/Volumes/osx-storage/projects/wd/windy-client/node_modules/@ngtools/webpack/src/loader.js:41:31)
at process._tickCallback (internal/process/next_tick.js:68:7)
ERROR in ../tuxin-ec-libs/tuxin-ec-product/tuxin-ec-product.service.ts
Module build failed (from ./node_modules/@ngtools/webpack/src/index.js):
Error: /Volumes/osx-storage/projects/wd/tuxin-ec-libs/tuxin-ec-product/tuxin-ec-product.service.ts is missing from the TypeScript compilation. Please make sure it is in your tsconfig via the 'files' or 'include' property.
at AngularCompilerPlugin.getCompiledFile (/Volumes/osx-storage/projects/wd/windy-client/node_modules/@ngtools/webpack/src/angular_compiler_plugin.js:762:23)
at plugin.done.then (/Volumes/osx-storage/projects/wd/windy-client/node_modules/@ngtools/webpack/src/loader.js:41:31)
at process._tickCallback (internal/process/next_tick.js:68:7)
При копировании каталогов в проект вместо их динамического связывания я не получаю эти ошибки.
так ... есть ли способ изменить angular.json, чтобы он поддерживал использование динамически связанных каталогов?
это мой angular.json:
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"version": 1,
"newProjectRoot": "projects",
"projects": {
"windy-client": {
"root": "",
"sourceRoot": "src",
"projectType": "application",
"prefix": "tuxin-ec",
"schematics": {
"@schematics/angular:component": {
"styleext": "scss"
}
},
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
"outputPath": "dist/windy-client",
"index": "src/index.html",
"main": "src/main.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "src/tsconfig.app.json",
"assets": [
"src/favicon.ico",
"src/assets"
],
"styles": [
"./node_modules/@angular/material/prebuilt-themes/indigo-pink.css",
"src/styles.scss"
],
"scripts": []
},
"configurations": {
"production": {
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.prod.ts"
}
],
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
"extractCss": true,
"namedChunks": false,
"aot": true,
"extractLicenses": true,
"vendorChunk": false,
"buildOptimizer": true,
"budgets": [
{
"type": "initial",
"maximumWarning": "2mb",
"maximumError": "5mb"
}
]
},
"development": {
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.dev.ts"
}
]
}
}
},
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"options": {
"browserTarget": "windy-client:build"
},
"configurations": {
"production": {
"browserTarget": "windy-client:build:production"
},
"development": {
"browserTarget": "windy-client:build:development"
}
}
},
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n",
"options": {
"browserTarget": "windy-client:build"
}
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"main": "src/test.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "src/tsconfig.spec.json",
"karmaConfig": "src/karma.conf.js",
"styles": [
"./node_modules/@angular/material/prebuilt-themes/indigo-pink.css",
"src/styles.scss"
],
"scripts": [],
"assets": [
"src/favicon.ico",
"src/assets"
]
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"src/tsconfig.app.json",
"src/tsconfig.spec.json"
],
"exclude": [
"**/node_modules/**"
]
}
}
}
},
"windy-client-e2e": {
"root": "e2e/",
"projectType": "application",
"prefix": "",
"architect": {
"e2e": {
"builder": "@angular-devkit/build-angular:protractor",
"options": {
"protractorConfig": "e2e/protractor.conf.js",
"devServerTarget": "windy-client:serve"
},
"configurations": {
"production": {
"devServerTarget": "windy-client:serve:production"
},
"development": {
"devServerTarget": "windy-client:serve:development"
}
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": "e2e/tsconfig.e2e.json",
"exclude": [
"**/node_modules/**"
]
}
}
}
}
},
"defaultProject": "windy-client"
}