<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:media="http://search.yahoo.com/mrss/"><channel><title>es6 on Neolisk's Tech Blog</title><link>/tags/es6/</link><description>Recent content in es6 on Neolisk's Tech Blog</description><generator>Hugo -- gohugo.io</generator><language>en</language><managingEditor>neolisk@gmail.com (Victor Zakharov)</managingEditor><webMaster>neolisk@gmail.com (Victor Zakharov)</webMaster><copyright>©2020-2024 Victor Zakharov. All Rights Reserved</copyright><lastBuildDate>Fri, 08 Oct 2021 00:00:00 +0000</lastBuildDate><atom:link href="/tags/es6/index.xml" rel="self" type="application/rss+xml"/><item><title>Webpack - Preserve Class Names During Minification</title><link>/posts/2021-10-08-webpack-minification-preserve-class-names/</link><pubDate>Fri, 08 Oct 2021 00:00:00 +0000</pubDate><author>neolisk@gmail.com (Victor Zakharov)</author><atom:modified>Mon, 11 Oct 2021 19:14:31 -0400</atom:modified><guid>/posts/2021-10-08-webpack-minification-preserve-class-names/</guid><description>Suppose you have the following ES6 code:
1 2 3 class MyFancyService { // ... } And you want to have a refactor safe way to output the service name without instantiating an object. With some googling, you will probably use the following approach:
1 2 const serviceName = MyFancyService.name; // and use serviceName in some way This will work fine in dev, until you decide to minify it with webpack.</description><dc:creator>Victor Zakharov</dc:creator><category>webpack</category><category>esbuild</category><category>esbuild-loader</category><category>es6</category></item></channel></rss>