rollup-plugin-template-replace
v0.3.0
Published
Replace the template expressions and restore them
Downloads
4
Readme
Replace the template expressions and restore them.
It won't process nested expressions.
import replace from "rollup-plugin-template-replace";
export default {
input: "index.js",
output: {
dir: "output",
format: "esm",
},
plugins: [
replace({
/* options */
}),
],
};Example, use a CSS preprocessor to process css literals.
replace({
match: (tag) => tag === "css",
callback: (input) => postcss(/* postcss plugins */).process(input).css.trim(),
replace: (_, index) => `--__REPLACE__${index}__`,
});