
🍣 A Rollup plugin which assets can be imported as strings using the ?raw suffix.
This plugin requires an LTS Node version (v14.0.0+) and Rollup v1.20.0+.
Using npm:
npm install rollup-plugin-import-raw --save-dev
Create a rollup.config.js configuration file and import the plugin:
import importRaw from 'rollup-plugin-import-raw'
export default {
input: 'src/index.js',
output: {
dir: 'output',
format: 'cjs',
},
plugins: [importRaw()],
}
Then call rollup either via the CLI or the API.
Examples:
imported tsconfig.ts file as string
import tsconfigStr from './tsconfig.ts?raw'
LICENSE (MIT)