one
Version:
One is a new React Framework that makes Vite serve both native and web.
19 lines (18 loc) • 607 B
JavaScript
function replaceLoader(param) {
var {
code,
loaderData
} = param,
stringifiedData = JSON.stringify(loaderData),
out = function () {
return code.includes("__vxrn__loader__") ? code.replace(/["']__vxrn__loader__['"]/,
// make sure this ' ' is added in front,
// minifiers will do `return"something"
// but if its null then it becomes returnnull
" " + stringifiedData.replace(/\$/g, "$$$$")) : code + `
export const loader = () => (${stringifiedData})`;
}();
return out;
}
export { replaceLoader };
//# sourceMappingURL=replaceLoader.native.js.map