Изменения, сделанные в файлах в node_modules - PullRequest
0 голосов
/ 08 мая 2018

Я изменил некоторые файлы в папке node_modules. Но когда я создаю приложение, используя ng build -op="app" --base -href="dist" --aot, и когда я развертываю его на сервере, я вижу, что изменений, которые я сделал в node_modules, там не было. Как это побороть?

Я пробовал в следующих 3 способов

  1. Я поставил ngx-bootstrap хранилище в GIT Тогда я использовал npm install https://github.com/krishnag9/ngx-bootstrap/tarball/master в своем проекте. Я изменил import { BsDaterangepickerDirective } from 'ngx-bootstrap/datepicker' на import { BsDaterangepickerDirective } from 'ngx-bootstrap-base/src/datepicker' Сейчас я сталкиваюсь со следующим исключением

    ERROR in ./node_modules/ngx-bootstrap-base/src/index.ts Module build failed: Error: NPMLINK_TEST/node_modules/ngx-bootstrap-base/src/index.ts is missing from the TypeScript compilation. Please make sure it is in your tsconfig via the 'files' or 'include' property. The missing file seems to be part of a third party library. TS files in published libraries are often a sign of a badly packaged library. Please open an issue in the library repository to alert its author and ask them to package the library using the Angular Package Format at AngularCompilerPlugin.getCompiledFile (NPMLINK_TEST/node_modules/@ngtools/webpack/src/angular_compiler_plugin.js:656:23) at plugin.done.then (NPMLINK_TEST/node_modules/@ngtools/webpack/src/loader.js:467:39) at <anonymous> at process._tickCallback (internal/process/next_tick.js:182:7) @ ./src/app/app.module.ts 49:12-45 54:12-45 @ ./src/main.ts @ multi webpack-dev-server/client?http://0.0.0.0:0 ./src/main.ts ERROR in ./node_modules/ngx-bootstrap-base/src/modal/index.ts Module build failed: Error: NPMLINK_TEST/node_modules/ngx-bootstrap-base/src/modal/index.ts is missing from the TypeScript compilation. Please make sure it is in your tsconfig via the 'files' or 'include' property. The missing file seems to be part of a third party library. TS files in published libraries are often a sign of a badly packaged library. Please open an issue in the library repository to alert its author and ask them to package the library using the Angular Package Format at AngularCompilerPlugin.getCompiledFile (NPMLINK_TEST/node_modules/@ngtools/webpack/src/angular_compiler_plugin.js:656:23) at plugin.done.then (NPMLINK_TEST/node_modules/@ngtools/webpack/src/loader.js:467:39) at <anonymous> at process._tickCallback (internal/process/next_tick.js:182:7) @ ./src/app/canceltickets/canceltickets.component.ts 21:14-53 22:14-53 @ ./src/app/app.module.ts @ ./src/main.ts @ multi webpack-dev-server/client?http://0.0.0.0:0 ./src/main.ts

  2. Также я попытался npm install https://github.com/krishnag9/ngx-bootstrap --save-dev в итоге с ошибкой ниже

    ERROR in node_modules/ngx-bootstrap-base/src/mini-ngrx/state.class.ts(5,39): error TS2305: Module '"NPMLINK_TEST/node_modules/rxjs/Rx"' has no exported member 'queueScheduler'. node_modules/ngx-bootstrap-base/src/tooltip/tooltip.directive.ts(20,10): error TS2305: Module '"NPMLINK_TEST/node_modules/rxjs/Rx"' has no exported member 'timer'. node_modules/ngx-bootstrap-base/src/typeahead/typeahead.directive.ts(18,10): error TS2305: Module '"NPMLINK_TEST/node_modules/rxjs/Rx"' has no exported member 'from'.

  3. Использование npm link Я клонировал git-репозиторий вне моего node_modules Далее cd ngx-bootstrap Я выполнил команду npm link Перенаправлено в папку node_modules Здесь я сделал npm link ngx-bootstrap В моей консоли нет ошибок, но код, который я изменил, там не отражается, а также в браузере появляется исключение

    BsDatepickerContainerComponent_Host.ngfactory.js? [sm]:1 ERROR TypeError: Cannot read property 'schedule' of undefined at ObserveOnSubscriber.scheduleMessage (observeOn.js:99) at ObserveOnSubscriber._error (observeOn.js:105) at ObserveOnSubscriber.Subscriber.error (Subscriber.js:105) at BehaviorSubject.Observable._trySubscribe (Observable.js:177) at BehaviorSubject.Subject._trySubscribe (Subject.js:97) at BehaviorSubject.Observable.subscribe (Observable.js:160) at ObserveOnOperator.call (observeOn.js:74) at AnonymousSubject.Observable.subscribe (Observable.js:157) at ScanOperator.call (scan.js:72) at AnonymousSubject.Observable.subscribe (Observable.js:157)

Ответы [ 2 ]

0 голосов
/ 19 мая 2018

Если вам просто нужно изменить значок, вы можете сделать это следующим образом.Всякий раз, когда срабатывает указатель даты, вы можете просто добавить следующие строки:

document.querySelector(".previous span").innerHTML = "<="

document.querySelector(".next span").innerHTML = "=>"

вы можете изменить "=>" любым значком, который вы хотите использовать.

Чтобы проверить это.Перейдите на https://valor -software.com / ngx-bootstrap / # / datepicker

Затем откройте любой сборщик дат и откройте консоль и вставьте его в консоль document.querySelector(".next span").innerHTML = "=>"

видите, что следующий значок меняется на =>

0 голосов
/ 08 мая 2018

Это зависит от того, как вы создаете свое приложение, возможно, от конфигурации вашего веб-пакета. Покажите нам конфигурацию вашего веб-пакета, вы должны настроить свой загрузчик так, чтобы он включал модуль.

...