-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
docs(configuration) : Add more option to resolve.alias #3358
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
|
Preview is ready Built with commit 23e7bf3 https://deploy-preview-3358--webpackjsorg-netlify.netlify.com |
|
friendly ping @montogeek :) Thanks |
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.
Types must be added after field declaration
|
@EugeneHlushko : friendly ping :) |
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.
Hi @jeffin143
Thank you for update!
Also, sorry for late response, although i think this is not ready yet, please see my comments
src/content/configuration/resolve.md
Outdated
| }; | ||
| ``` | ||
|
|
||
| `resolve.alias` when set to `false` will ignore a module. |
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 am not really clear from reading it, what exactly happens, webpack won't bundle it? e.g. import will not result in an error and its value will be undefined? e.g.
import x from './ignored-module';
console.log(x); // undefined
Or no?
Also text can be improved:
| `resolve.alias` when set to `false` will ignore a module. | |
| Setting `resolve.alias` to `false` will tell webpack to ignore a module. |
src/content/configuration/resolve.md
Outdated
| ### `resolve.alias` | ||
|
|
||
| `object` | ||
| `object` `[string]` `boolean: false` |
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.
resolve.alias always takes object I guess.
The changes you are recommending is fit for resolve.alias[key],
cause the changes are recommending
resolve: {
alias: "string";
or;
alias: false;
}Which I think is not a valid.
it should be
resolve: {
alias: {
_: string; // or false
}
}So the description is not describing that. Could you make those changes ?
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.
You are completely right, great spot!
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.
An array of strings is possible , so it could be any of object and array of strings
Edit : It is array of object
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.
The all confusion was created because of
Resolve.alias.alias
The second alias accepts string bool or [string]
|
Hi @jeffin143 |
sure I will take a look it this week, completely went of the list |
|
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/webpack-docs/webpack-js-org/5wp05j7bq |
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.
just two minor things left
src/content/configuration/resolve.md
Outdated
| W> [`null-loader`](https://github.com/webpack-contrib/null-loader) will be deprecated in `webpack@5`. use `alias: { xyz$: false }` or absolute path `alias: {[path.resolve(__dirname, "....")]: false }` | ||
| W> [`null-loader`](https://github.com/webpack-contrib/null-loader) is deprecated in `webpack@5`. use `alias: { xyz$: false }` or absolute path `alias: {[path.resolve(__dirname, "....")]: false }` | ||
|
|
||
| W> `[string]` values are supported since webpack 5.0.0. |
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.
It's still in beta, lets just say 5 here too?
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.
Done, Let's get this merged, It has been sitting here for almost 6 months now :)
Co-Authored-By: Eugene Hlushko <jhlushko@gmail.com>
|
Thanks! |
describe your changes...
add alias to false (ignore) and alias to array, Handling : #3178