This repository was archived by the owner on May 29, 2019. It is now read-only.
Commit 8de6558
fix: get real path from
Without this fix, this plugin doesn't work if your node_modules tree is
made up of directories, but your files are symlinks. It's admittedly a
weird environment, but that's the environment that the Bazel build
system runs code in, which is the build system we use at Dropbox.
This is the bug:
- index.js is called from the runfiles directory, and it uses the
realpath of its directory as the key for a function on the
loaderContext object.
- loader.js is called from the bazel-bin/npm directory outside
of its runfiles (because Webpack escapes the runfiles when it
calls loaders). It uses the realpath of its directory as a
key on the loaderContext object, but because it's in a
different directory from index.js, it can't find the function
set on the loaderContext by index.js.
The fix is to get the realpath of the filename instead of the
directory so that both files point to the same place.__filename instead of __dirname (NS)1 parent 510704f commit 8de6558
2 files changed
+3
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
| 20 | + | |
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
| 2 | + | |
2 | 3 | | |
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
9 | | - | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
| |||
0 commit comments