UNPKG

zephyr-rspack-plugin

Version:

Repack plugin for Zephyr

11 lines (10 loc) • 486 B
const { rewriteEnvReadsToVirtualModule } = require('zephyr-agent'); module.exports = function(source) { const options = this && 'function' == typeof this.getOptions ? this.getOptions() : {}; if ('function' != typeof rewriteEnvReadsToVirtualModule) return source; try { const res = rewriteEnvReadsToVirtualModule(String(source), options && options.specifier); if (res && 'string' == typeof res.code) return res.code; } catch (_e) {} return source; };