0

I've made a custom angular module library and after using it in my main app the library doesn't work and this is the warning that shows up

Critical dependency: the request of a dependency is an expression

Here's how I'm importing the library

import { MyLibraryModule } from 'my-lib'

in package.json

"library": "file:../dist/UI-library"

Currently I'm installing the from a local directory where the dist files of build library are built.

1 Answer 1

1

In your library go to the dist/library folder and run npm pack This will create a .tgz file of your lib. Then in your package.json file install the library from this packaged .tgz file. Like:

 "library": "file:./library.tgz"

When you publish to npm this is what npm does and that's what you install when you run an npm install a .tgz packaged file.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.