The `liferay-npm-bundler-preset-angular` package provides a specialized configuration preset for `liferay-npm-bundler`, designed to streamline the bundling and optimization of Angular projects for deployment within the Liferay Portal environment. It consolidates a set of Babel presets (specifically `babel-preset-liferay-standard`) and Liferay NPM Bundler plugins (like `liferay-npm-bundler-plugin-replace-browser-modules` and `liferay-npm-bundler-plugin-inject-angular-dependencies`) into a single, easy-to-use configuration. This ensures Angular applications are correctly processed for Liferay's module federation and runtime requirements. The current stable version is 1.8.0, and its release cadence is typically tied to the broader `liferay-npm-build-tools` ecosystem rather than an independent schedule. Its key differentiator is simplifying complex build setups for Angular developers working with Liferay by providing a pre-baked, opinionated solution.
npm install liferay-npm-bundler-preset-angularNo compatibility data collected yet for this library.
Shows how to configure your project's `.npmbundlerrc` file to use the Angular preset, including typical output and global settings.
Consult the official Liferay documentation and `liferay-npm-build-tools` release notes for compatibility matrices and migration guides before upgrading.
Ensure that custom Babel configurations do not duplicate or conflict with presets and plugins already included by `babel-preset-liferay-standard`. Prefer extending the preset's configuration rather than defining entirely separate ones.
Verify that your `.npmbundlerrc` `output.globals` section correctly maps Angular packages (e.g., `@angular/core`) to the Liferay-provided global variables as shown in the quickstart example.
Run `npm install --save-dev liferay-npm-bundler-preset-angular` in your project's root directory.
Double-check the `output.globals` section in your `.npmbundlerrc` against the Liferay documentation for the correct Angular global variable names. Ensure the Liferay portal itself is configured to provide these globals.
While the preset includes standard Babel support, complex or bleeding-edge syntax might require explicit additional Babel configuration. Consider adding custom Babel plugins/presets to your `.npmbundlerrc`'s `plugins` array (if supported by `liferay-npm-bundler`) or configuring Babel directly if the bundler allows it.