Библиотека Angular 6 не может найти относительный путь к node_modules при распространении библиотеки на другие компьютеры - PullRequest
0 голосов
/ 17 декабря 2018

Исходный файл TypeScript

import { Injectable } from '@angular/core';
import { transaction, snapshotManager } from '@datorama/akita';
import { tap } from 'rxjs/operators';
import { Business, transformBusiness } from 'smb-sp-models/business';
import { BusinessStore } from './business.store';
import { BusinessDataService } from './business-data.service';


@Injectable({
providedIn: 'root'
})
export class BusinessService {

    constructor(
        private businessStore: BusinessStore,
        private businessDataService: BusinessDataService
    ) {        
    }

    setQueryString(query: string) {
        this.businessDataService.setQueryString(query);
    }

    get() {
        return this.businessDataService.get().pipe(tap( (data: any) => {
            this.businessStore.set(data.data);
        }));
    }

    getById(id: string) {
        return this.businessDataService.getById(id).pipe(tap( (data: any) => {
            const entity = data;
            this.businessStore.createOrReplace(entity.businessId, entity);
        }));
    }

    getPage(opt?) {
        return this.businessDataService.get(opt);
    }

    @transaction()
    add(entity: Business) {
        this.businessStore.add(entity);
        return this.businessDataService.add(entity);
    }

    @transaction()
    update(entity: Business) {
        this.businessStore.update(entity.businessId, entity);
        return this.businessDataService.update(entity);
    }

    @transaction()
    replace(entity: Business) {
        this.businessStore.createOrReplace(entity.businessId, entity);
    }

    @transaction()
    remove(entity: Business) {
        this.businessStore.remove(entity.businessId);
    }

}

Файл в папке dist после запуска ng build

import { Business } from 'smb-sp-models/business';
import { BusinessStore } from './business.store';
import { BusinessDataService } from './business-data.service';
export declare class BusinessService {
    private businessStore;
    private businessDataService;
    constructor(businessStore: BusinessStore, businessDataService: BusinessDataService);
    setQueryString(query: string): void;
    get(): import("../../../../../../../../../Volumes/TINNAKORNC/wip/web/smartbiz/node_modules/rxjs/internal/Observable").Observable<any>;
    getById(id: string): import("../../../../../../../../../Volumes/TINNAKORNC/wip/web/smartbiz/node_modules/rxjs/internal/Observable").Observable<any>;
    getPage(opt?: any): import("../../../../../../../../../Volumes/TINNAKORNC/wip/web/smartbiz/node_modules/rxjs/internal/Observable").Observable<import("../../../../../../../../../Volumes/TINNAKORNC/wip/web/smartbiz/node_modules/@datorama/akita/src/plugins/paginator/paginator-plugin").PaginationResponse<Business>>;
    add(entity: Business): import("../../../../../../../../../Volumes/TINNAKORNC/wip/web/smartbiz/node_modules/rxjs/internal/Observable").Observable<any>;
    update(entity: Business): import("../../../../../../../../../Volumes/TINNAKORNC/wip/web/smartbiz/node_modules/rxjs/internal/Observable").Observable<any>;
    replace(entity: Business): void;
    remove(entity: Business): void;
}

Вопросы Пожалуйста, помогите мне, что является причиной этой проблемы?Я создаю библиотеку на Mac и хочу распространять библиотеку на любые Windows или другие компьютеры, и они не могут видеть путь, как в приведенном выше коде (который встроил путь Mac).Спасибо

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...