-
-
Notifications
You must be signed in to change notification settings - Fork 9.1k
add options to warn on using Node.js features #14212
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
For maintainers only:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think make sense to add test there we use global = 1
and const global = 1
, i.e. we are free these variables to usage
futureDefaults applies next major defaults adds node.global=warn node.__filename=warn-mock node.__dirname=warn-mock
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For Commonhs and ECMA modules for web target we output only warnings?
@vankop The most important CI builds failed. This way your PR can't be merged. Please take a look at the CI results from azure (0 errors / 0 warnings) and appveyor (failure) and fix these issues. |
Thanks |
I've created an issue to document this in webpack/webpack.js.org. |
What kind of change does this PR introduce?
fixes #14210 #14229
Did you add tests for your changes?
yes
Does this PR introduce a breaking change?
no
What needs to be documented once your changes are merged?
new experiment
futureDefaults
that applies defaults of next major version and add warnings in problematic placesadd options:
node.global=warn - warns on global usage
node.__dirname="warn-mock" - warns on __dirname usage
node.__filename="warn-mock" - warns on __filename usage