Registry /
devops / liferay-npm-build-support
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
muslnode 18–226 runs
build_error
glibcnode 18–226 runs
build_error
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
LiferayWebpackConfig
✓ import LiferayWebpackConfig from 'liferay-npm-build-support/webpack-config';
✗ const LiferayWebpackConfig = require('liferay-npm-build-support/webpack-config');
This package primarily exposes build configurations and loaders. Direct programmatic imports like this are less common, as functionality is often consumed via CLI or integrated build processes. This is an illustrative example for a hypothetical webpack configuration helper.
LiferaySassLoader
✓ import { liferaySassLoader } from 'liferay-npm-build-support/loaders';
A hypothetical named export for a custom SASS loader, typically used within Webpack configurations (e.g., `module.rules`). Direct import into application code is rare, as usage is usually indirect via configuration.
BuildUtils
✓ import * as BuildUtils from 'liferay-npm-build-support/utils';
Illustrative example for a module exporting general build utility functions. Actual paths and exports would depend on the specific internals of the package, which are often not designed for public programmatic consumption.
Demonstrates a typical `package.json` configuration for a Liferay module, using `liferay-npm-build-support` as a `devDependency` and leveraging `liferay-npm-scripts` (which internally uses `liferay-npm-build-support`) to run standard build, deploy, start, and test commands for Liferay projects.
{
"name": "my-liferay-module",
"version": "1.0.0",
"description": "A sample Liferay module using build support",
"main": "index.js",
"scripts": {
"build": "liferay-npm-scripts build",
"deploy": "liferay-npm-scripts deploy",
"start": "liferay-npm-scripts start",
"test": "liferay-npm-scripts test"
},
"devDependencies": {
"liferay-npm-build-support": "^2.32.0",
"liferay-npm-scripts": "^51.0.0"
}
}
Debug
Known issues
gotchaThis package is part of the Liferay frontend ecosystem and is primarily designed to work with Liferay Portal. Its utilities, scripts, and loaders are highly tailored to Liferay's module structure, OSGi environment, and specific tooling (like Liferay JS Toolkit). Attempting to use it outside of a Liferay context is generally not recommended and will likely lead to compatibility issues.fixEnsure you are developing for a Liferay Portal environment and follow Liferay's official project generation and build guidelines. Use Liferay's project templates to ensure correct setup.
affects: >=1.0.0
breakingUpdates to Node.js versions often require corresponding updates in Liferay's build tooling. For instance, recent versions introduced explicit support for Node.js v20. Older versions of `liferay-npm-build-support` (and related `npm-scripts`) may not be fully compatible with newer Node.js runtimes, potentially causing build failures or unexpected behavior.fixRefer to the `liferay-frontend-projects` changelog and Liferay's official documentation for supported Node.js versions. Always update `liferay-npm-build-support` and `liferay-npm-scripts` to the latest compatible versions when upgrading your Node.js runtime.
affects: <51.2.0 (for liferay-npm-scripts sub-package context)
gotchaThe `liferay-npm-build-support` package, particularly through `liferay-npm-scripts`, handles OSGi fragment detection. Incorrectly configured modules might be erroneously identified as OSGi fragments, leading to build abortion in newer versions, where previously they might have passed with warnings or silent issues.fixReview module configurations and ensure they correctly declare their OSGi fragment status if applicable. Consult Liferay's module development documentation for proper configuration.
affects: >=51.0.0 (for liferay-npm-scripts sub-package context)
Errors
Common errors & fixes
Error: Cannot find module 'webpack/lib/ModuleFilenameHelpers'
Webpack version incompatibility. Liferay's build tools are tightly coupled to specific Webpack versions, and direct upgrades or differing versions in a project's dependency tree can cause conflicts.
fixAlign your project's Webpack version with the one expected by `liferay-npm-build-support` and `liferay-npm-scripts`. Often, the easiest fix is to rely solely on the versions managed by Liferay's tooling.
Error: Node Sass compiler not found. Please install node-sass.
Missing `node-sass` dependency or incompatibility with Node.js version. `node-sass` can be notoriously sensitive to Node.js version changes.
fixEnsure `node-sass` is installed as a `devDependency` (e.g., `npm install node-sass --save-dev`). Check `node-sass` compatibility matrix for your Node.js version, or consider using `sass` (Dart Sass) if supported by your Liferay build environment, as some versions of `npm-scripts` allow disabling `sass` via flags.
Error: `Module aliases that start with '.' are not handled correctly` (or similar resolution errors)
Older versions of the build support had issues resolving relative module aliases or paths, particularly when they started with a dot, leading to module resolution failures.
fixUpdate `liferay-npm-build-support` (specifically `liferay-js-toolkit` sub-package context) to version `2.32.0` or newer, which includes a fix for this specific module alias resolution problem. Ensure your `package.json` specifies compatible versions.
Audit
Dependencies
liferay-js-toolkitrequiredProvides foundational utilities and CLI for Liferay frontend projects; liferay-npm-build-support often serves as a backend for its operations.
liferay-npm-scriptsoptionalOften used in conjunction for standardized build tasks in Liferay projects, building upon the support provided here.
liferay-theme-tasksoptionalFor Liferay theme development, this package's loaders and scripts underpin theme-specific build processes.