This package, `liferay-npm-bundler-loader-copy-loader`, serves as a specialized loader for `liferay-npm-bundler`, designed to facilitate the copying of files within a Liferay frontend project's build process. It allows developers to define rules in their `.npmbundlerrc` configuration to copy assets, such as images, fonts, or other static files, from a specified source to the output directory. The current stable version is 2.32.2. While specific release cadence for this individual loader is not explicitly stated, it is part of the larger Liferay frontend projects monorepo, which appears to have an active and ongoing release schedule across its various components. Its primary differentiator is its tight integration with the Liferay build tooling, providing a declarative way to manage asset copying specifically within that ecosystem.
npm install liferay-npm-bundler-loader-copy-loaderVerified import paths — ran on the pinned version, not inferred.
This configuration snippet for `.npmbundlerrc` demonstrates how to use `liferay-npm-bundler-loader-copy-loader` to copy different types of assets (images, fonts, documents, and specific files) from various source paths to designated `dest` directories within the Liferay module output.
Thoroughly test your `test` regex patterns with `regex101.com` or similar tools, and verify the build output to confirm only desired files are copied. Start with specific patterns and gradually broaden if necessary.
Ensure installation using `npm install --save-dev liferay-npm-bundler-loader-copy-loader`.
Always verify the output structure after a build. The `dest` path dictates the subdirectory within the module's target folder. For example, `"dest": "images"` will place files into `/o/{module-name}/images/`.Install the package as a development dependency: `npm install --save-dev liferay-npm-bundler-loader-copy-loader`.
Review the `test` pattern for syntax errors or incorrect matching criteria. Ensure the `dest` path is correctly specified and the target directory in the build output is checked for the copied files.