mirror of https://github.com/espruino/BangleApps
Merge branch 'minify_online'
commit
b7e4476d4d
|
@ -156,6 +156,7 @@
|
|||
<script src="js/comms.js"></script>
|
||||
<script src="js/appinfo.js"></script>
|
||||
<script src="js/index.js"></script>
|
||||
<script src="js/espruinotools.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/marked/marked.min.js"></script>
|
||||
<script src="js/pwa.js" defer></script>
|
||||
</body>
|
||||
|
|
|
@ -11,6 +11,16 @@ var AppInfo = {
|
|||
return Promise.resolve(storageFile);
|
||||
else if (storageFile.url)
|
||||
return fileGetter(`apps/${app.id}/${storageFile.url}`).then(content => {
|
||||
if (storageFile.url.endsWith(".js") && !storageFile.url.endsWith(".min.js")) { // if original file ends in '.js'...
|
||||
return Espruino.transform(content, {
|
||||
SET_TIME_ON_WRITE : false,
|
||||
PRETOKENISE : true,
|
||||
//MINIFICATION_LEVEL : "ESPRIMA", // disable due to https://github.com/espruino/BangleApps/pull/355#issuecomment-620124162
|
||||
builtinModules : "Flash,Storage,heatshrink,tensorflow,locale"
|
||||
});
|
||||
} else
|
||||
return content;
|
||||
}).then(content => {
|
||||
return {
|
||||
name : storageFile.name,
|
||||
content : content,
|
||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue