The `liferay-npm-bundler-plugin-inject-angular-dependencies` package is a specialized plugin for `liferay-npm-bundler` designed to address the challenges of deploying Angular applications within Liferay Portal's npm architecture. Its primary function is to automatically inject necessary peer dependencies (such as `rxjs` for `@angular/forms`) that the Liferay NPM Bundler may not correctly resolve or bundle by default. This ensures Angular packages function correctly at runtime, preventing 'module not found' errors. As of version 1.8.0, it remains critical for bridging the gap until `liferay-npm-bundler` offers full, native `peerDependency` support. The plugin determines the correct dependency versions by scanning the output `node_modules` directory. Its release cadence is typically tied to updates and maintenance within the broader Liferay ecosystem, focusing on compatibility and stability for Angular projects in Liferay Portal.
npm install liferay-npm-bundler-plugin-inject-angular-dependenciesVerified import paths — ran on the pinned version, not inferred.
This `.npmbundlerrc` snippet globally enables the `inject-angular-dependencies` plugin without any custom options, applying it to all bundles.
Avoid using `dependenciesMap` unless absolutely necessary. Monitor Liferay-NPM-Bundler updates for permanent solutions to dependency issues.
Regularly check `liferay-npm-bundler` release notes for enhancements in `peerDependency` resolution and be prepared to update or remove this plugin.
Thoroughly test your bundled Angular applications and inspect the dependency tree to ensure the plugin is resolving dependencies as expected without introducing conflicts.
Add `"inject-angular-dependencies"` to the `plugins` array in your `.npmbundlerrc` file to ensure these dependencies are forcibly injected.
Ensure `liferay-npm-bundler-plugin-inject-angular-dependencies` is correctly configured and that no other bundling plugins or manual configurations are causing duplicate or conflicting injections of core Angular libraries.