mirror of
https://github.com/romancm/gamebrary
synced 2024-11-24 20:23:06 +00:00
12 lines
258 B
JavaScript
12 lines
258 B
JavaScript
|
'use strict'
|
||
|
|
||
|
const fs = require('fs')
|
||
|
const UglifyJS = require('uglify-es')
|
||
|
|
||
|
module.exports = function(filePath) {
|
||
|
const code = fs.readFileSync(filePath, 'utf-8')
|
||
|
const result = UglifyJS.minify(code)
|
||
|
if (result.error) return ''
|
||
|
return result.code
|
||
|
}
|