I have an Angular app (v13.3.10) and I'm using the ngx-markdown package as a dependency. I'm finding a lot of bugs in this package. To fix this, I'm trying to edit it locally and view changes in-browser when running ng serve
. But webpack seems to always take an unedited version of the source files in this package. (this package unfortunately doesn't have a dist
folder).
Researching this, I tried both using patch-package (setting a postinstall script) as well as disabling angular CLI's build cache. But no matter what, Webpack stays firm and doesn't apply local changes on ng serve
.
Why does webpack not let me change source files to view in localhost? What else can I do from here?
CodePudding user response:
- Change your node module name
- Then in terminal run
npm i
- Now you get new node module file
- then run your code ng serve
CodePudding user response:
Can you make the same changes that were made in src folder to the file in esm2020, fesm 2020 folders. Those are the files referenced by webpack.
CodePudding user response:
Going to answer my own question here. The issue is that the ngx-markdown package is an Angular library. Angular has webpack configured such that no libraries are allowed to be edited. The best you can do is either:
- Fork, make edits, import as a custom angular library
- Send a pull request to the original repo and wait for a merge.