You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Mar 20, 2024. It is now read-only.
In this repo there's the ability to import the example library shorten with @bazel/shorten. Starting with a greenfield repo I'm adding similar examples (literally copy/paste from the shorten example). However, I'm unable to import it directly with @bazel/sample-lib but I'm able to have a relative import ../lib/sample-lib/shorten (as long as the shorten path is added to the ng_module deps). Has the API changed since that doesn't allow this?
Thus, I don't have a BUILD.bazel in the src root folder and I'm starting to think that this is what's missing. However, I'd like to not have a BUILD.bazel in the root if that file is going to compile everything in the directory and bloat the builds of the smaller apps.
Ideally we can have small individual builds amongst 5 or 6 independent apps running under the src/ folder each with their own dependencies/requirements. So something like this:
At the moment this is technically working and it's fine but it would be nice to just have our own package name imports to make life a bit easier. I'm also happy to add in a BUILD file in the root to expose the libs as long as we're not pulling in extraneous code from other apps.
I think module_root="" is a strange thing to write. "duplicates the path as shorten/shorten and hence cannot find the correct files." sounds like you're using a structure we don't support, but it's hard to say without a small repro.
Also you misunderstand - a Bazel package is all the files under the nearest ancestor BUILD.bazel file. Thus the files in src/subdirectory aren't part of the src package if a src/subdirectory/BUILD.bazel file exists, so no, having a BUILD.bazel file in the root doesn't bloat anything.
Sorry you didn't get a reply, we haven't been good about watching this repo for issues. The example is moving to bazelbuild/rules_nodejs which my team does triage.
Please open a new issue there, ideally with a repro
In this repo there's the ability to import the example library shorten with
@bazel/shorten
. Starting with a greenfield repo I'm adding similar examples (literally copy/paste from the shorten example). However, I'm unable to import it directly with@bazel/sample-lib
but I'm able to have a relative import../lib/sample-lib/shorten
(as long as the shorten path is added to the ng_module deps). Has the API changed since that doesn't allow this?What my shorten sample looks like:
My app's structure is slightly different than this repo but it's fairly similar; it looks like this
Thus, I don't have a BUILD.bazel in the src root folder and I'm starting to think that this is what's missing. However, I'd like to not have a BUILD.bazel in the root if that file is going to compile everything in the directory and bloat the builds of the smaller apps.
Ideally we can have small individual builds amongst 5 or 6 independent apps running under the src/ folder each with their own dependencies/requirements. So something like this:
At the moment this is technically working and it's fine but it would be nice to just have our own package name imports to make life a bit easier. I'm also happy to add in a BUILD file in the root to expose the libs as long as we're not pulling in extraneous code from other apps.
package.json:
The text was updated successfully, but these errors were encountered: