Registry / web-framework / liferay-npm-bundler-preset-react

liferay-npm-bundler-preset-react

JSON →
library1.8.0jsnpmunverified

React preset configuration for liferay-npm-bundler, a build tool for Liferay portlets. Version 1.8.0 is the latest stable release. This preset provides Babel presets and bundler plugins necessary to transpile and bundle React code for Liferay environments, including babel-preset-liferay-standard and liferay-npm-bundler-plugin-replace-browser-modules. Key differentiator: simplifies integration of React into Liferay's module system, handling module replacement and standard JS transformations. Development is ongoing but release cadence is low.

npm install liferay-npm-bundler-preset-react
INSTALL
IMPORT
SIG · LIFERAY-NPM-BUNDLE
L
liferay-npm-bundler-preset-react
web-frameworkjavascriptv1.8.0
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.

liferay-npm-bundler-preset-react
Add 'liferay-npm-bundler-preset-react' as a value for the 'preset' key in .npmbundlerrc. No JavaScript import needed.
import preset from 'liferay-npm-bundler-preset-react'
This package is not imported in JavaScript; it is configured declaratively in .npmbundlerrc. The preset is loaded by liferay-npm-bundler during build.
Babel Presets
Babel presets are included automatically by the preset; no manual import required.
Manually specifying babel presets in .babelrc
The preset manages all Babel configuration. Overriding may conflict with preset's plugins.
Plugins
Plugins are included automatically by the preset; no manual configuration needed.
Adding liferay-npm-bundler-plugin-replace-browser-modules individually to .npmbundlerrc
The preset already includes this plugin; adding it again may cause duplication errors.

Shows installation and configuration of preset in .npmbundlerrc, including specifying React dependencies.

// Ensure liferay-npm-bundler is installed: npm install --save-dev liferay-npm-bundler // Install this preset: npm install --save-dev liferay-npm-bundler-preset-react // Create .npmbundlerrc in project root: cat > .npmbundlerrc <<EOF { "preset": "liferay-npm-bundler-preset-react", "config": { "imports": { "react": "^16.0.0", "react-dom": "^16.0.0" } } } EOF // Run build: npm run build
Debug
Known issues
breakingPreset requires liferay-npm-bundler version that supports 'preset' configuration.
fix
Update liferay-npm-bundler to a compatible version (e.g., >=2.0.0).
affects: >=1.0.0
deprecatedUse of this preset may be superseded by newer Liferay build tools (e.g., liferay-js-toolkit).
fix
Consider migrating to liferay-js-toolkit for ongoing support.
affects: >=1.0.0
gotchaIf using React 17+ or 18+, the bundled react and react-dom versions may be outdated.
fix
Manually specify newer React versions in .npmbundlerrc's 'imports' section.
affects: >=1.0.0
gotchaPreset assumes a Liferay environment; not intended for generic React projects.
fix
Use a standard React build tool (e.g., Create React App) for non-Liferay projects.
affects: >=1.0.0
Errors
Common errors & fixes
liferay-npm-bundler: The preset "liferay-npm-bundler-preset-react" cannot be found.
The preset package is not installed or is not in node_modules.
fix
Run `npm install --save-dev liferay-npm-bundler-preset-react`.
Error: Cannot find module 'babel-preset-liferay-standard'
Dependency missing due to npm hoisting issues.
fix
Add 'babel-preset-liferay-standard' to your devDependencies explicitly.
TypeError: Cannot read property 'preset' of undefined
Missing .npmbundlerrc file or malformed JSON.
fix
Create a valid .npmbundlerrc with a 'preset' field.
Upgrade
Version history
1.8.0latest on npm
Audit
Dependencies
liferay-npm-bundlerrequiredThis preset configures liferay-npm-bundler and requires it to be installed as a peer dependency.
babel-preset-liferay-standardrequiredTranspiles standard JavaScript features required by Liferay.
liferay-npm-bundler-plugin-replace-browser-modulesrequiredReplaces browser-specific modules with Liferay-compatible implementations.
Agent activity
2 hits · last 30 days
node
2
Resources
liferay-npm-bundler-preset-react — npm install liferay-npm-bundler-preset-react · libregistry