Please sign in to comment.
Fix route template path handling (#1253)
Consider that we store the artifacts on an OS temporary directory (such as what you would get with `mktemp -d` or `node-tmp`) which we can assume for simplicity purposes to be `/tmp/react-static`. In the snippet above, `route.template` is a path such as `/home/johndoe/site/lib/pages/main.js`. Therefore `path.relative()` will calculate the path to `/home/johndoe/site/lib/pages/main.js` from `/tmp/react-static`, so the result will be something like `../home/johndoe/site/lib/pages/main.js` which makes no sense and will cause react-static to fail. What we really intended is `path.resolve()`, so that the user still gets `/home/johndoe/site/lib/pages/main.js`.
- Loading branch information...
Showing with 3 additions and 1 deletion.