This repos show that currently next.js
does not inject variables through DefinePlugin
into CJS files.
yarn
yarn build
At this point you will see that SOME_CONSTANT
is not defined.
Follow these steps:
- Open
node_modules/test-package/package.json
- Remove the
main
field yarn build
Now next.js
successfully uses DefinePlugin
to inject SOME_CONSTANT
.