Coralite v0.28.4 Released
Coralite v0.28.4 is now available. This release addresses static asset copying issues, adding flexible configuration options and fallback resolution paths to ensure seamless module integration.
Robust Static Asset Resolution #
In modern Node.js environments, dependency packages may restrict access to internal file paths, causing module resolution to fail with errors such as ERR_PACKAGE_PATH_NOT_EXPORTED when resolving files like package.json. This release updates the staticAssetPlugin to support packages with non-exported paths through two key enhancements:
First, we have introduced an optional src property to the CoraliteStaticAsset definition. This allows developers to bypass module resolution entirely by specifying an explicit, absolute file path to the asset source.
// coralite.config.js
export default {
staticAssets: [
{
name: "custom-package",
src: "/absolute/path/to/source/assets", // Bypasses module resolution entirely
dest: "public/assets"
}
]
};
Second, if module resolution is utilized and fails during require.resolve(), the plugin now utilizes a directory traversal fallback strategy to find the asset folder and copy resources gracefully.
This update includes updated reference documentation and complete unit and end-to-end tests validating the fallback resolution behavior.
How to Upgrade #
To upgrade to the latest version, update your project dependencies:
npm install coralite@0.28.4
npm install coralite-scripts@0.28.4
