rollup-plugin-import-assert
JSON →A Rollup plugin that enables import assertions (formerly import attributes) for CSS and JSON modules, allowing developers to import stylesheets as constructible stylesheets and JSON modules with type assertions. Version 3.0.1 works with Rollup 3+ and requires acorn-import-assertions as a peer dependency. It transforms CSS imports into CSS module scripts for use with adoptedStyleSheets. Compared to alternatives like @rollup/plugin-json or raw CSS imports, this plugin provides standardized import assertion syntax as per the TC39 proposal, but only supports static imports with literal assertion values. It does not handle dynamic imports with dynamic expressions. The package ships TypeScript definitions.
Traffic · last 30 days ↑0% vs prev 7d
top countries 🇺🇸 United States · 🇨🇦 Canada · 🇪🇸 Spain · 🇬🇧 United Kingdom