mirror of
https://github.com/EmulatorJS/EmulatorJS.git
synced 2024-09-20 02:46:23 +00:00
Nest minified code in a function
This commit is contained in:
parent
9d17345e6d
commit
55fb909ffc
3 changed files with 4 additions and 2 deletions
|
@ -4201,3 +4201,4 @@ class EmulatorJS {
|
||||||
this.gameManager.setCheat(index, checked, code);
|
this.gameManager.setCheat(index, checked, code);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
window.EmulatorJS = EmulatorJS;
|
||||||
|
|
2
data/emulator.min.js
vendored
2
data/emulator.min.js
vendored
File diff suppressed because one or more lines are too long
|
@ -11,10 +11,11 @@ let files = [
|
||||||
'socket.io.min.js',
|
'socket.io.min.js',
|
||||||
'emulator.js'
|
'emulator.js'
|
||||||
]
|
]
|
||||||
let code = "";
|
let code = "(function() {\n";
|
||||||
for (let i=0; i<files.length; i++) {
|
for (let i=0; i<files.length; i++) {
|
||||||
code += fs.readFileSync('../'+files[i], 'utf8') + "\n";
|
code += fs.readFileSync('../'+files[i], 'utf8') + "\n";
|
||||||
}
|
}
|
||||||
|
code += "\n})();"
|
||||||
|
|
||||||
function minify(source){
|
function minify(source){
|
||||||
const ast = UglifyJS.parse(source);
|
const ast = UglifyJS.parse(source);
|
||||||
|
|
Loading…
Reference in a new issue