I'm a big fan of Exception Driven Development. Because the big amount of client-side JavaScript in modern day applications, this means we also collect JavaScript exceptions by sending them to the server.
But as far as I can think of this excludes the use of a minifier? It destroys all the useful information by showing errors like:
k is undefined, line 2 column 23489 in function l()
Are there any workarounds for that?
More info Maybe one option would be to create a metadata file at the moment you're minimizing. When this meta data lives on the server, it can remap the minimized error to the original variables and linenumbers with the metadata. Sounds like a lot of work though.
To minify JavaScript, try UglifyJS. The Closure Compiler is also very effective. You can create a build process that uses these tools to minify and rename the development files and save them to a production directory.
It is important to minify your CSS and minimise JavaScript files so they can load faster on your web pages. There are many reasons why you should minify your CSS and JavaScript: Reduce file size: The more code there is in a file, the larger it will be. Minified code is usually much smaller than the original version.
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.
Download the files that you want to minify from your website. Save a copy as a backup. Copy the content of the file and paste it to the appropriate minifier tool. Once it's done, paste the code back into the downloaded file and upload it to your website directory.
You can use Javascript source maps after minification to check where the error actually is (and this supports your idea of metafiles).
Hope this article will help you and I understood you right. http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/
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