My electron application is getting bigger and bigger, with lots of HTML, JS and CSS source files. What I need to know is if when creating the distribution with electron-builder by running yarn dist
, the JS/CSS files are minified?
Do I have to do this before myself if it's worth it? Can I add this middle step in here?
"scripts": {
"start": "electron .",
"pack": "electron-builder --dir",
"dist": "electron-builder",
"postinstall": "electron-builder install-app-deps"
},
I use Visual Studio Code and could use Gulp but I need to know if there's some other method most people use, if they do care about minifying/obfuscating code. I would prefer not to separate my scripts into two folders and minify from one to another. Maybe there's a tool that does this at creating the distribution
Go to minifycode.com and click the CSS minifier tab. Then paste the CSS code into the input box and click the Minify CSS button. After the new minified code is generated, copy the code. Then go back to the css file of your website and replace the code with the new minified version.
Despite being an excellent programming language, JavaScript impacts web pages by slowing them down. To regain space and improve your page load speed, you must minify the JavaScript code. The minified version of JavaScript code can reduce the file size by as much as 30–90%.
Minification is the process of minimizing code and markup in your web pages and script files. It's one of the main methods used to reduce load times and bandwidth usage on websites. Minification dramatically improves site speed and accessibility, directly translating into a better user experience.
electron-builder builds the Electron app for the current platform and current architecture as the default target. Linux: If you build on Windows or macOS, Snap and AppImage for x64 will be the output. Otherwise if you build on Linux, the output will be Snap and AppImage files for the current architecture.
The code isn't minified, as said in this issue comment, so you have to minify it yourself using UglifyJS for example.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With