{"id":13452,"library":"liferay-npm-bundler-plugin-resolve-linked-dependencies","title":"Liferay NPM Bundler Linked Dependencies Resolver","description":"The `liferay-npm-bundler-plugin-resolve-linked-dependencies` package serves as a critical plugin for the `liferay-npm-bundler`. Its core function is to identify and replace `file://` protocol-based linked dependencies within a project's `node_modules` with their actual semantic version numbers during the bundling process. This capability is essential for Liferay frontend development workflows, especially in scenarios involving monorepos or local development where packages are linked rather than installed from a remote registry. By doing so, it ensures that the final bundled output accurately reflects concrete package versions, preventing potential issues arising from local file paths in production builds. The current stable version, 2.32.2, reflects ongoing development within the broader `liferay-frontend-projects` monorepo. Its release cadence is closely tied to updates in the Liferay Portal and its frontend tooling ecosystem, which frequently incorporates new features and bug fixes. The plugin differentiates itself by specifically addressing the unique challenges of dependency linking and resolution inherent in the Liferay build environment, providing a robust solution for maintaining consistent dependency references.","status":"active","version":"2.32.2","language":"javascript","source_language":"en","source_url":"https://github.com/liferay/liferay-frontend-projects","tags":["javascript"],"install":[{"cmd":"npm install liferay-npm-bundler-plugin-resolve-linked-dependencies","lang":"bash","label":"npm"},{"cmd":"yarn add liferay-npm-bundler-plugin-resolve-linked-dependencies","lang":"bash","label":"yarn"},{"cmd":"pnpm add liferay-npm-bundler-plugin-resolve-linked-dependencies","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"This package is a plugin designed to extend the functionality of `liferay-npm-bundler`. It is a required peer dependency for the plugin to operate.","package":"liferay-npm-bundler","optional":false}],"imports":[{"note":"This plugin is activated by its string identifier within the `plugins` array of the `.npmbundlerrc` configuration file. It is not imported as a JavaScript module in application code or directly invoked.","wrong":"import { resolveLinkedDependencies } from 'liferay-npm-bundler-plugin-resolve-linked-dependencies';","symbol":"resolve-linked-dependencies (in .npmbundlerrc)","correct":"{\n  \"*\": {\n    \"plugins\": [\"resolve-linked-dependencies\"]\n  }\n}"}],"quickstart":{"code":"// First, install the plugin as a development dependency:\n// npm install --save-dev liferay-npm-bundler-plugin-resolve-linked-dependencies\n\n// Then, configure your .npmbundlerrc file to include the plugin:\n// This JSON object represents the content of a typical .npmbundlerrc file.\nconst npmBundlerConfig = {\n  \"*\": { // Apply this configuration to all modules\n    \"plugins\": [\n      \"resolve-linked-dependencies\" // Enable the linked dependencies resolver plugin\n      // You can add other Liferay NPM Bundler plugins here\n    ],\n    \"externs\": { // Example of other common bundler options\n      \"jquery\": \"$\",\n      \"lodash\": \"_\"\n    }\n  }\n};\n\n// In a Liferay project, the bundler would typically be executed\n// via an npm script, e.g., 'npm run build:bundle' which calls 'liferay-npm-bundler'.\n// The plugin will automatically run as part of the bundling process.\nconsole.log(\"Example .npmbundlerrc configuration:\\n\", JSON.stringify(npmBundlerConfig, null, 2));","lang":"javascript","description":"This quickstart demonstrates how to install the plugin and configure `liferay-npm-bundler` via the `.npmbundlerrc` file to enable linked dependency resolution during the build process."},"warnings":[{"fix":"Always consult the `liferay-npm-bundler` changelog and documentation when upgrading Liferay frontend tooling. Verify compatibility and update your `.npmbundlerrc` configuration or plugin version as needed.","message":"This plugin's functionality is tightly coupled with `liferay-npm-bundler`. Significant changes to the bundler's core API or configuration format in new major versions may indirectly cause breaking behavior or require updates to this plugin's integration.","severity":"gotcha","affected_versions":">=1.0"},{"fix":"Ensure your local development environment utilizes `file://` references or `npm link` for packages you intend this plugin to resolve. Confirm the presence of these linked dependencies within your `node_modules` directory.","message":"This plugin specifically targets dependencies linked using `file://` protocols in `package.json` or those created via `npm link`. It does not affect standard dependencies installed from npm registries (e.g., `npm install`).","severity":"gotcha","affected_versions":">=1.0"}],"env_vars":null,"last_verified":"2026-04-19T00:00:00.000Z","next_check":"2026-07-18T00:00:00.000Z","problems":[{"fix":"Verify that `liferay-npm-bundler-plugin-resolve-linked-dependencies` is listed in your `package.json`'s `devDependencies` and is installed (run `npm install`). Check the spelling of the plugin name in your `.npmbundlerrc` file.","cause":"The plugin package is either not installed, misspelled in the configuration, or not discoverable by `liferay-npm-bundler`.","error":"Error: Cannot find plugin 'resolve-linked-dependencies'"},{"fix":"Confirm that `resolve-linked-dependencies` is correctly listed in the `plugins` array of your `.npmbundlerrc` file. Inspect your `node_modules` to ensure the dependency is indeed a `file://` link or an `npm link`. Check for any conflicting bundler configurations that might override plugin behavior.","cause":"The plugin might not be correctly configured in `.npmbundlerrc`, or the dependency in question is not being recognized as a linked dependency that requires resolution by the plugin.","error":"Bundled module still contains 'file://' paths for linked dependencies"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":"","cli_version":null}