Registry / devops / liferay-npm-bundler-plugin-inject-imports-dependencies

liferay-npm-bundler-plugin-inject-imports-dependencies

JSON →
library2.32.2jsnpmunverified

This is a specialized plugin for the `liferay-npm-bundler`, designed to automate the process of adding dependencies declared as imports within a project's `.npmbundlerrc` configuration directly into its `package.json` file. This streamlines dependency management for Liferay frontend modules, ensuring that all bundled modules are correctly listed as project dependencies, which is critical for Liferay Portal's OSGi-based module system. The current stable version of this plugin is 2.32.2. However, it's crucial to note that its host, `liferay-npm-bundler`, has been officially deprecated as of Liferay 2024.Q4/Portal GA129 and is slated for future removal. This plugin, therefore, is also considered deprecated as it relies entirely on the deprecated bundler's functionality. It served a key role in Liferay's prior frontend development workflow for packaging npm modules into OSGi bundles.

npm install liferay-npm-bundler-plugin-inject-imports-dependencies
INSTALL
IMPORT
SIG · LIFERAY-NPM-BUNDLE
L
liferay-npm-bundler-plugin-inject-imports-dependencies
devopsjavascriptv2.32.2
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

"inject-imports-dependencies"
// In .npmbundlerrc plugins array: { "*": { "plugins": ["inject-imports-dependencies"] } }
import { injectImportsDependencies } from 'liferay-npm-bundler-plugin-inject-imports-dependencies'
This package is a bundler plugin and is configured declaratively as a string in the `plugins` array within the `.npmbundlerrc` file. It does not export any JavaScript symbols for direct import.
No direct CommonJS exports
N/A
const injectPlugin = require('liferay-npm-bundler-plugin-inject-imports-dependencies');
Attempting to `require` this package in Node.js will not provide the plugin functionality. Its purpose is solely for configuration within `liferay-npm-bundler`.
No direct ES Module exports
N/A
import * as InjectImportsPlugin from 'liferay-npm-bundler-plugin-inject-imports-dependencies';
This package does not expose an ES Module API for programmatic use. Its functionality is activated through its string name in the `.npmbundlerrc` configuration.

This quickstart demonstrates how to install the plugin and enable it in your Liferay frontend project's `.npmbundlerrc` file to automatically inject declared import dependencies into `package.json`. **Note:** The underlying `liferay-npm-bundler` and its plugins are deprecated.

npm install --save-dev liferay-npm-bundler-plugin-inject-imports-dependencies // Then, create or update your .npmbundlerrc file in your project root: // (Example showing typical structure and plugin configuration) { "*": { "plugins": [ "inject-imports-dependencies" ] }, // Example: Define an import that the plugin should inject as a dependency "imports": { "some-lcom-module": { ".": "/node_modules/some-lcom-module/index.js" }, "another-utility": { ".": "/node_modules/another-utility/dist/main.js" } } }
Debug
Known issues
breakingThe underlying `liferay-npm-bundler` (which this plugin extends) has been officially deprecated as of Liferay 2024.Q4/Portal GA129 and is planned for future removal. Liferay is transitioning to standard JavaScript tooling (e.g., esbuild, Webpack, Vite) for frontend development. Using this plugin in new projects or continuing its use in existing projects beyond the stated deprecation timeline will lead to an unsupported and eventually non-functional build process.
fix
Plan migration of Liferay frontend projects away from `liferay-npm-bundler` and its plugins to modern JavaScript bundlers (esbuild, Webpack, Vite) as recommended by Liferay. Remove `liferay-npm-bundler-plugin-inject-imports-dependencies` and its configuration from `.npmbundlerrc` files.
affects: >=2.32.2
gotchaThis plugin is tightly coupled with `liferay-npm-bundler` and the Liferay frontend build ecosystem. Ensure compatibility between the plugin's version, the bundler's version, and your Liferay Portal version to avoid unexpected build failures or incorrect dependency injection.
fix
Consult the Liferay frontend projects documentation or changelog for specific compatibility matrices. Upgrade or downgrade `liferay-npm-bundler` and related toolkit packages as needed.
affects: >=1.0.0
Errors
Common errors & fixes
Plugin 'inject-imports-dependencies' not found or invalid.
The plugin name is misspelled in `.npmbundlerrc` or the package was not installed correctly.
fix
Verify that `liferay-npm-bundler-plugin-inject-imports-dependencies` is listed in your `devDependencies` and that 'inject-imports-dependencies' is correctly spelled in the 'plugins` array within your `.npmbundlerrc` file. Ensure the plugin is placed in the correct `pre-process` or `post-process` phase if specified.
Declared imports are not being added to package.json dependencies.
The `liferay-npm-bundler-plugin-inject-imports-dependencies` plugin might not be correctly activated or there are issues with the `imports` configuration itself in `.npmbundlerrc`.
fix
Ensure the plugin is correctly listed in the `plugins` array in your `.npmbundlerrc`. Double-check the structure and paths within your `imports` configuration to ensure they are valid and resolvable by the bundler. Check bundler logs for any warnings or errors during the build process.
Upgrade
Version history
2.32.2latest on npm
Audit
Dependencies
liferay-npm-bundlerrequiredThis package is a plugin for liferay-npm-bundler and requires it for functionality. Note that liferay-npm-bundler itself is deprecated.
Agent activity
2 hits · last 30 days
node
2
Resources
liferay-npm-bundler-plugin-inject-imports-dependencies — npm install liferay-npm-bundler-plugin-inject-imports-dependencies · libregistry