change uglify rules which eliminate necessary code with new style

This commit is contained in:
Stewart Allen 2022-02-22 22:00:50 -05:00
commit 195ad046b9
2 changed files with 5 additions and 2 deletions

6
app.js
View file

@ -176,7 +176,7 @@ function init(mod) {
const list = val.map(p => p.charAt(0) === '&' ? p.substring(1) : p); const list = val.map(p => p.charAt(0) === '&' ? p.substring(1) : p);
const cache = {}; const cache = {};
const roots = []; const roots = [];
// xxxx = key === "mesh_work"; // xxxx = key === "kiri_work";
// for each path in the list, find deps and add to list // for each path in the list, find deps and add to list
for (let path of val) { for (let path of val) {
let fc = path.charAt(0); let fc = path.charAt(0);
@ -750,7 +750,9 @@ function minify(path) {
if (path.indexOf("ext/three.js") > 0) { if (path.indexOf("ext/three.js") > 0) {
return code; return code;
} }
let mini = uglify.minify(code.toString()); let mini = uglify.minify(code.toString(), {
compress: { unused: false }
});
if (mini.error) { if (mini.error) {
console.trace(mini.error); console.trace(mini.error);
throw mini.error; throw mini.error;

View file

@ -6,6 +6,7 @@
// dep: geo.polygons // dep: geo.polygons
// dep: geo.wasm // dep: geo.wasm
// dep: kiri.codec // dep: kiri.codec
// dep: kiri.slice
// dep: moto.license // dep: moto.license
// use: kiri-mode.cam.driver // use: kiri-mode.cam.driver
// use: kiri-mode.cam.animate // use: kiri-mode.cam.animate