Closed Arti3DPlayer closed 7 years ago
So compiled the sources, that's fine. How do you dunle the app? If you use nw-builder, then your resulting package is an executable, which gets replaced with new one during the update. If it's just an archive (zip, gz) you can go with custom swap https://github.com/dsheiko/nw-autoupdater#writing-custom-swap-script - make it simply replace your *.bin file.
You can examine the demos included in the package, When you run on a client npm run package
it creates the app package on the server. During updates client downloads the archive, unpacks temporarily, and run swap in a detached process to replace old app folder with newly downloaded and unpacked one
I do not know is this the right way to protect source. But to not lose startup speed, I configured nw-builder
to use next sources:
src: [
'app/**',
'!app/**/*.js',
'icons/**',
'package.json',
'node_modules/angular.js/angular.js.min.js',
]
So i compiled my .js
files to bin and exclude them, to protect. And external libraries like yours, just include. So what i want is to do like:
'node_modules/nw-autoupdater/nw-autoupdater.min.js',
. Now this doesn't work, because module has a lot of dependencies
You are as they themselves say you lose about 30% of performance. Besides, it's easy to decompile. I believe with JAvaScript there is no alternative to obfuscation. I personally rely on https://jscrambler.com for production code
@dsheiko no, they fixed issue with loose performance in 0.22+. Now it works perfectly)
So is this possible to get rid of dependencies and use your library as one file ?
I assume you can bundle it together with all the dependencies by using Webpack in a single file, but why?!
@dsheiko Thanks, i didn't know about webpack:)
In my project i use
nwjc
to protect my source code. I uglify all my js files to one and then usenwjc app/all.min.js app/app.bin
But after i installed your library I get about new 30 folders with a lot of dependencies .... Is this possible somehow to include in your project
.min.js
version, that doesn't need any dependencies ?I tried, but they are so deep, that i can't make it work after minimize file
Thanks