Search code examples
angularng-packagr

Angular - Include librairie files in root application


I have a librairie which have a js folder, which contains multiples js files.

When I build it, I success to include all files in builded librairie. So, files are on dist/my-lib/lib/js.

But, I cannot access to those files from URL via http://localhost:4200/lib/js for example. How can I do ?


Solution

  • You can include the needed folder from dist to what you want, thanks to assets.

    Angular.json:

    {
      "projects": {
        "my-app": {
          "architect": {
            "build": {
              "options": {
                "assets": [
                  "dist/my-lib/lib/js"
                ]
              }
            }
          }
        }
      }
    }