Skip to content

Commit

Permalink
update build script so uglify can gather all files
Browse files Browse the repository at this point in the history
  • Loading branch information
Steven-Eardley committed Jan 15, 2024
1 parent 5acbb13 commit 4b2c228
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions build.js
Original file line number Diff line number Diff line change
Expand Up @@ -307,8 +307,9 @@ if (args.bundle && typeof bundle === 'object') {
}
}
if (js.length) {
var uglify = require("uglify-js");
uglyjs = uglify.minify(js);
const uglify = require("uglify-js");
const path = require('path');
uglyjs = uglify.minify(js.map(_path => JSON.stringify(path.normalize(_path))));
uglyjs.error ? console.log(uglyjs.error) : (
jshash = 'bundled_' + crypto.createHash('md5').update(uglyjs.code).digest("hex"),
fs.writeFileSync('./serve/static/' + jshash + '.min.js', uglyjs.code)
Expand Down

0 comments on commit 4b2c228

Please sign in to comment.