Getting working directory and file name in react & webpack
<p>I am working with a react js project. i am using webpack and redux with that. Here is the folder structure of my project. </p>

<pre><code>-assets
-src  
 -component   
  -index.jsx  
 -container   
  -index.jsx
</code></pre>

<p>For now i want to use dynamic className for the index.jsx files according to their working directory name. Example:</p>

<p>for index.jsx in the folder component, the className will be</p>

<blockquote>
  <p>src-component</p>
</blockquote>

<p>for index.jsx in the folder container, the className will be</p>

<blockquote>
  <p>src-component</p>
</blockquote>

<p>I have tried to use npm module path for that. But the __dirname gives the output of the url of the browser '/'. How can i get that pwd from the jsx file. </p>