How to prevent users from seeing the source code of the Pluggable Web Widget?

0
I built a Pluggable Web Widget. How can I prevent users from seeing the source code in the browser? This means that you see a compiled.js file instead of a.tsx file
asked
1 answers
0

Here do you mean COMPILED or OBFUSCATED?

In the Scripts Section of the Pluggable Widget you can choose to do this by adding another step in the workflow. 

Also the web code which is responsible for the widget is already minified by the Bundler(i think Rollup) which should be enough to put DEVs off :P

So as a test you can go inside the node_modules > @mendix/pluggable-widget-tools > config > rollup.config.js > in the plugins section add the rollup-obfuscator plugin.

Then as per this plugin documentation you can see if the Obfuscation is happening as per your needs.


Once the DEV mode is yielding the desired result you could think of including this in the release scripts of the Widget.

 

I have not done this inside mendix but have used something similar in my current org. internal CLI project for NodeJS.

 

Good luck.

 

answered