I’m not sure if Bubble’s compiler minifies code that is used within workflows. It certainly minifies all plugin code, but it’s possible that it doesn’t ‘see’ the code used in the Run Javascript action.
Minification doesn’t offer real security for your code - it’s there to reduce the file sizes - but it does make it really hard to read. For example:
var profit = 1000;
var scaler = 0.3;
function secretCalc(input, multiplier) {
return (input *100) / multiplier;
}
console.log(secretCalc(profit, scaler);
Becomes:
var n=1e3;var r=.3;function e(n,r){return n*100/r}console.log(e(n,r));
And this code will be sat within a sea of other a, b and c variables and functions. From personal experience I can tell you it’s between really hard --> impossible to work out what’s going on. So once you’ve written your code you can use a tool like this to minify it.
Alternatively you can run your code server side (Backend Workflows in Bubble) and then it will never touch the client. Toolbox has a server side action too - Server Script - you can see how it works here. You’ll need to save the return
value to the database in order to access it back on the client.