I am using Webpack in a TypeScript project.
In my configureStore.dev.ts file, I want to use module.hot from Webpack to enable HMR.
My problem is that hot by default does not exist in the NodeModule module, and setting @types/webpack-env does not solve my problem.
@types/node conflicts with @type/webpack-env
After searching in the definition of @types/webpack-env they define the Module interface, where everything is clearly defined.
But there was a conflict on the line:
declare var module: __WebpackModuleApi.Module;
Since Module has already been defined by @types/node as a NodeModule .
Just removed @types/node and hot now available on Module .
process now undefined
Now that I have removed @types/node , I cannot check
process.env.NODE_ENV === 'production'
How to determine the process ?
source share