Open schoren opened 5 years ago
@schoren, thanks for your change. My imports looks way nicer now.
I also have a some generated files and I was dealing with the same cross platform problem. I tried #48 but it didn't work for me because the generated files are under 'bazel-out/darwin-fastbuild/genfiles' not under 'bazel-out/darwin-fastbuild/bin' . Adding GENDIR path without modifications solves the problem.
const gendir = path.join(base, process.env["GENDIR"], '..', 'bin')
const gendir2 = path.join(base, process.env["GENDIR"])
See #53 which is currently working for me.
I have encountered 2 issues with import resolving:
js_library
that lives in a parent path, I have to use a lot of'../..'
in the path. That makes it hard to move files around without breaking anything.Example:
jsonnet
. I then import them as ajs_library
, but the path is something like this:bazel-out/k8-fastbuild/bin/app/config.json
.Exampe:
The problem is that the fastbuild dir is prefixed with the target architecture (k8/darwin). Then, I cannot resolve the import in a cross platform way. If I use the
k8
prefix, it won't work on MacOS, and vice versa.I have created #48 to solve both issues. I think the implementatios is pretty generic, so it should work for anyone.
Thanks