My current directory is
D:\\bkp\\Programming\\TestWorks\\nodejs\\testApp
but when i am using __dirname and trying to show a file
__dirname
This is because webpack can handle __dirname (and other node specific things) in different ways. If you want it to behave like normal, use this in your webpack config:
{ node: { __dirname: false } }
See: https://webpack.js.org/configuration/node/