Skip to content

Commit c80e3d9

Browse files
authored
Merge pull request #629 from terinjokes/terinjokes/config-alias-file
config: show module to file example
2 parents 48a1816 + d3226ab commit c80e3d9

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

content/configuration/index.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ contributors:
77
- grgur
88
- bondz
99
- sricc
10+
- terinjokes
1011
---
1112

1213
Webpack is fed via a configuration object. It is passed in one of two ways depending on how you are using webpack: through the terminal or via Node.js. All the available configuration options are specified below.
@@ -224,11 +225,15 @@ T> Notice that throughout the configuration we use Node's built-in [path module]
224225
[alias](/configuration/resolve#resolve-alias): {
225226
// a list of module name aliases
226227
227-
"module": "new-module"
228+
"module": "new-module",
228229
// alias "module" -> "new-module" and "module/path/file" -> "new-module/path/file"
229230
230231
"only-module$": "new-module",
231232
// alias "only-module" -> "new-module", but not "module/path/file" -> "new-module/path/file"
233+
234+
"module": path.resolve(__dirname, "app/third/module.js"),
235+
// alias "module" -> "./app/third/module.js" and "module/file" results in error
236+
// modules aliases are imported relative to the current context
232237
},
233238
<details><summary>/* alternative alias syntax (click to show) */</summary>
234239
[alias](/configuration/resolve#resolve-alias): [

0 commit comments

Comments
 (0)