{"id":22085,"library":"rollup-plugin-inline-js","title":"rollup-plugin-inline-js","description":"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.","status":"active","version":"0.5.0","language":"javascript","source_language":"en","source_url":"https://github.com/eight04/rollup-plugin-inline-js","tags":["javascript","rollup-plugin","rollup","inline-js","inliner","static","assets"],"install":[{"cmd":"npm install rollup-plugin-inline-js","lang":"bash","label":"npm"},{"cmd":"yarn add rollup-plugin-inline-js","lang":"bash","label":"yarn"},{"cmd":"pnpm add rollup-plugin-inline-js","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Peer dependency; required for plugin to function","package":"rollup","optional":false}],"imports":[{"note":"ESM-only; CommonJS require will not work.","wrong":"const inline = require('rollup-plugin-inline-js')","symbol":"default","correct":"import inline from 'rollup-plugin-inline-js'"},{"note":"The module exports a function as default; named export createPlugin is also available.","wrong":"import createPlugin from 'rollup-plugin-inline-js'","symbol":"createPlugin","correct":"import { createPlugin } from 'rollup-plugin-inline-js'"},{"note":"TypeScript users can import the type for inlineOptions object.","wrong":null,"symbol":"InlineOptions","correct":"import type { InlineOptions } from 'rollup-plugin-inline-js'"}],"quickstart":{"code":"import inline from 'rollup-plugin-inline-js';\n\nexport default {\n  input: 'src/entry.js',\n  output: {\n    file: 'dist/bundle.js',\n    format: 'esm'\n  },\n  plugins: [\n    inline({\n      include: ['*.js'],\n      exclude: ['node_modules/**'],\n      inlineOptions: { /* inline-js-core options */ }\n    })\n  ]\n};","lang":"typescript","description":"Shows how to configure the plugin in a Rollup config file with include/exclude patterns and inline options."},"warnings":[{"fix":"Update rollup to ^2.38.5 and plugin to 0.5.0.","message":"Upgrade to rollup@2.38.5 required; older versions incompatible.","severity":"breaking","affected_versions":"<0.5.0"},{"fix":"Migrate to use $inline directives in source code directly.","message":"Plugin rewritten in 0.3.0; $inline directives now transform source files instead of using a different mechanism.","severity":"breaking","affected_versions":"<0.3.0"},{"fix":"Use Node.js 8 or later.","message":"Node.js >=8 required; older versions may fail.","severity":"gotcha","affected_versions":">=0.5.0"},{"fix":"Remove dependencies array from plugin options.","message":"Dependencies array deprecated; use include/exclude instead.","severity":"deprecated","affected_versions":">=0.4.0"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Update rollup to ^2.38.5.","cause":"Rollup version mismatch.","error":"Error: The plugin \"rollup-plugin-inline-js\" is not compatible with this version of Rollup! Expected: ^2.38.5"},{"fix":"Use import inline from 'rollup-plugin-inline-js' (ESM) instead of require().","cause":"Using CommonJS require() instead of ES import.","error":"TypeError: inline is not a function"},{"fix":"Ensure .inline.js file is present or provide inlineOptions in plugin configuration.","cause":"Missing or misconfigured .inline.js file or inlineOptions.","error":"Error: No configuration found for inline-js"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}