{"library":"rollup-plugin-inline-code","title":"rollup-plugin-inline-code","description":"A Rollup plugin that loads files as plain text strings, akin to Webpack's raw-loader, using a configurable import prefix (default 'inline!'). Version 1.2.7 is the current stable release, published via semantic-release with automated versioning. It supports Node.js 12–16 and works with JavaScript, TypeScript, SVG, and any text-based assets. The plugin integrates seamlessly into Rollup builds, enabling inline injection of file contents into generated bundles—a common pattern in server-side rendering or HTML template generation. Unlike similar plugins, it uses a distinctive import prefix syntax to differentiate inline imports from standard module imports.","language":"javascript","status":"active","last_verified":"Mon Apr 27","install":{"commands":["npm install rollup-plugin-inline-code"],"cli":null},"imports":["import inlineCode from 'rollup-plugin-inline-code'","import content from 'inline!./path/to/file.js'","declare module 'inline!*' { const inlineCode: string; export default inlineCode; }"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"// rollup.config.js\nimport inlineCode from 'rollup-plugin-inline-code';\n\nexport default {\n  input: 'src/index.js',\n  output: {\n    file: 'dist/bundle.js',\n    format: 'iife'\n  },\n  plugins: [inlineCode()]\n};\n\n// src/index.js\nimport scriptContent from 'inline!./inline.js';\nconsole.log(scriptContent);\n\n// src/inline.js\n// This file will be read as text\nconst greeting = 'Hello from inline!';\n","lang":"typescript","description":"Shows basic Rollup setup with plugin and usage of the inline prefix to import a JavaScript file's raw content.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}