uniswap-interface-uncensored/scripts/terser-loader.js
Zach Pomerantz 5e1c430657
build: improve tree-shaking (#7325)
* build: improve tree-shaking

* dedup terser
2023-09-21 11:29:22 -07:00

16 lines
356 B
JavaScript

/* eslint-env node */
const { minify } = require('terser')
module.exports = async function terserLoader(source, map, meta) {
const callback = this.async()
const options = this.getOptions()
try {
const data = await minify(source, options)
const { code } = data || {}
callback(null, code, map, meta)
} catch (e) {
callback(e)
}
}