dify/web/bin/uglify-embed.js

10 lines
283 B
JavaScript
Raw Permalink Normal View History

const fs = require('node:fs')
// https://www.npmjs.com/package/uglify-js
const UglifyJS = require('uglify-js')
const { readFileSync, writeFileSync } = fs
writeFileSync('public/embed.min.js', UglifyJS.minify({
'embed.js': readFileSync('public/embed.js', 'utf8'),
}).code, 'utf8')