0.2.1 • Published 4 months ago
rollup-plugin-dedent v0.2.1
rollup-plugin-dedent
A Rollup plugin to dedent multi-line string during build time.
Install
npm install rollup-plugin-dedent --save-dev
Usage
Create a rollup.config.js
configuration file, or add it to your vite.config.js
, and import the plugin:
// rollup.config.js
import { dedentPlugin } from "rollup-plugin-dedent";
export default {
// ...
plugins: [dedentPlugin()],
};
// vite.config.js;
import { defineConfig } from "vite";
import { dedentPlugin } from "rollup-plugin-dedent";
export default defineConfig({
// ...
plugins: [dedentPlugin()],
});
import dedent from "dedent";
function usageExample() {
const first = dedent`A string that gets so long you need to break it over
multiple lines. Luckily dedent is here to keep it
readable without lots of spaces ending up in the string
itself.`;
}
console.log(usageExample());
License
MIT