UNPKG

@magento/pwa-buildpack

Version:

Build/Layout optimization tooling and Peregrine framework adapters for the Magento PWA

13 lines (12 loc) 340 B
module.exports = Operation => class ReplaceOperation extends Operation { setup() { this.state.seen = new Set(); } run(path) { if (!this.state.seen.has(path.node)) { this.state.seen.add(path.node); path.replaceWith(this.jsx); } } };