PostCSS plugin that rewrites relative URL paths in CSS/SCSS to absolute URLs using the ROOT_URL environment variable. Version 0.1.3, released 2021. Simple, single-purpose tool for Meteor/Node/Webpack builds. Avoids hard-coded roots per environment. Limited configuration: enables per property. Currently no active development.
npm install postcss-absolute-root-urlNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows how to use the plugin to replace relative url() in CSS with absolute URL from ROOT_URL environment variable.
Ensure ROOT_URL is set in your build script (e.g., via dotenv or shell).
Explicitly enable necessary properties in options (e.g., 'background-image', 'src').
Ensure postcss-easy-import is listed first in PostCSS plugins order.
Test with your PostCSS version; consider forking or using alternative like postcss-url.
Set process.env.ROOT_URL to your absolute base URL before running PostCSS.
Ensure CSS is valid and plugin is applied after postcss-easy-import and any other transform plugins.