UNPKG

@inertia-volt/vite

Version:

A simple Vite plugin for stripping PHP tags from JavaScript components.

19 lines (18 loc) 377 B
const r = /<\?php(\n|\s|\t)[\s\S]*?\?>[\n\s\t]+/g; function s(e) { return e.replace(r, ""); } function i(e) { return { name: "inertia-volt-transformer", transform(t, n) { if (n.includes(e.path) && n.endsWith(e.extension) && n.includes("inertia") && t.includes("<?php")) return { code: s(t) }; } }; } export { i as default };