Skip to content
This repository was archived by the owner on Jun 5, 2021. It is now read-only.
This repository was archived by the owner on Jun 5, 2021. It is now read-only.

Enhance import resolving #49

Description

@schoren

I have encountered 2 issues with import resolving:

  1. If I have to import a file from a 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:

.
|-- app
|---- src
|------ index.js (import '../../lib/common/net.js';)
|-- lib
|---- commonn
|------ net.js
  1. I create some json files using jsonnet. I then import them as a js_library, but the path is something like this: bazel-out/k8-fastbuild/bin/app/config.json.

Exampe:

import '../../bazel-out/k8-fastbuild/bin/app/config.json';

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions