Skip to content

Commit

Permalink
Merge pull request #3123 from Zemnmez/fix-absolute-import-issue
Browse files Browse the repository at this point in the history
fix absolute import issue
  • Loading branch information
Zemnmez authored May 24, 2023
2 parents a5e6730 + ea84de9 commit e187200
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 8 deletions.
6 changes: 4 additions & 2 deletions deploy/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,10 @@ ts_project(

js_binary(
name = "release",
data = [":release_src"],
entry_point = "release.ts",
data = [
":release_src"
],
entry_point = "release.js",
)

js_test(
Expand Down
19 changes: 13 additions & 6 deletions js/rules.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,16 @@ load("@aspect_rules_js//npm:defs.bzl", _npm_link_package = "npm_link_package", _
load("@aspect_bazel_lib//lib:copy_to_bin.bzl", _copy_to_bin = "copy_to_bin")
load("//js/copy_to_local:copy_to_local.bzl", _copy_to_local = "copy_to_local")

def js_binary(name, **kwargs):
_js_binary(name = name, **kwargs)
def _apply_env_defaults(d):
return d | {"NODE_PATH": "."}

def js_test(name, **kwargs):
_js_test(name = name, env = {"NODE_PATH": "."}, **kwargs)
def js_binary(name, env = {}, **kwargs):
env = _apply_env_defaults(env)
_js_binary(name = name, env = env, **kwargs)

def js_test(name, env = {}, **kwargs):
env = _apply_env_defaults(env)
_js_test(name = name, env = env, **kwargs)

def js_library(name, **kwargs):
_js_library(name = name, **kwargs)
Expand All @@ -18,8 +23,10 @@ def copy_to_bin(name, **kwargs):
def pkg_npm(name, **kwargs):
_pkg_npm(name = name, **kwargs)

def js_run_binary(name, **kwargs):
_js_run_binary(name = name, env = {"NODE_PATH": "."}, **kwargs)
def js_run_binary(name, env = {}, **kwargs):
env = _apply_env_defaults(env)

_js_run_binary(name = name, env = env, **kwargs)

def npm_link_package(name, **kwargs):
_npm_link_package(name = name, **kwargs)
Expand Down

0 comments on commit e187200

Please sign in to comment.