Do you want to request a feature or report a bug?
Bug.
What is the current behavior?
- Setup in webpack.config.js
module.resolver: [ path.resolve(__dirname, 'src'), 'node_modules' ]
. - Create file
src/constants/index.js
with content, e.g.module.exports = { SOME_CONST: SOME_CONST' };
- Require this file as
require('constants')
. - Get nodejs constants object contains
EEXIST
andSIGTERM
.
The same with import
.
If the current behavior is a bug, please provide the steps to reproduce.
You may clone webpack-require-constants and do following:
cd webpack2
npm install
npm run build
- Open public/index.html file.
What is the expected behavior?
I’m not really sure is it a bug in webpack2 or webpack1. Webpack1 requires src/constants
. You can see it in the same repo in directory webpack1.
Please mention other relevant information such as the browser version, Node.js version, webpack version and Operating System.
- nodejs v7.1.0
- webpack@2.3.3 — requires nodejs constants
- webpack@1.14.0 — requires
src/constants
- mac os 10.10.5
I added an alias which fixed this: