Rollup plugin to inline static assets at build time using inline-js directives. Version 0.5.0 supports Rollup ^2.38.5. It replaces $inline directives in source files, similar to the inline-js CLI. The plugin is maintained but has infrequent updates. Key differentiators: it works as a transform plugin, allowing inline directives directly in source code rather than requiring a separate processing step.
npm install rollup-plugin-inline-jsVerified import paths — ran on the pinned version, not inferred.
Shows how to configure the plugin in a Rollup config file with include/exclude patterns and inline options.
Update rollup to ^2.38.5 and plugin to 0.5.0.
Migrate to use $inline directives in source code directly.
Use Node.js 8 or later.
Remove dependencies array from plugin options.
Update rollup to ^2.38.5.
Use import inline from 'rollup-plugin-inline-js' (ESM) instead of require().
Ensure .inline.js file is present or provide inlineOptions in plugin configuration.