<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Mohi</title>
    <description>The latest articles on DEV Community by Mohi (@mohi).</description>
    <link>https://dev.to/mohi</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F202774%2F1fc835af-5140-4e74-be8d-da9567d032ea.jpeg</url>
      <title>DEV Community: Mohi</title>
      <link>https://dev.to/mohi</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/mohi"/>
    <language>en</language>
    <item>
      <title>WebPack 5: Using named exports from JSON modules</title>
      <dc:creator>Mohi</dc:creator>
      <pubDate>Wed, 24 Aug 2022 10:00:35 +0000</pubDate>
      <link>https://dev.to/mohi/webpack-5-using-named-exports-from-json-modules-21a8</link>
      <guid>https://dev.to/mohi/webpack-5-using-named-exports-from-json-modules-21a8</guid>
      <description>&lt;p&gt;If you work with JavaScript, or you've ever interacted with a JavaScript project, Node.js or a frontend project, you surely met the &lt;code&gt;package.json&lt;/code&gt; file.&lt;/p&gt;

&lt;p&gt;In the &lt;strong&gt;JavaScript&lt;/strong&gt; application under package.json file, you can see the one property called version. We can use this version while deploying to indicate the different versions of the application.&lt;/p&gt;

&lt;p&gt;in WebPack 4 the version can be accessed in our application by simply importing this file as below:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import { version } from '../../package';
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After migration to WebPack 5 The version can be accessed in our application by simply importing this file as below:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import packageInfo from 'package.json';

export default packageInfo.version;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>webpack5</category>
      <category>javascript</category>
      <category>json</category>
    </item>
  </channel>
</rss>
