Questions tagged [bazel-rules-nodejs]

27 questions
1
vote
1 answer

How should I invoke webpack to bundle bazel's ts_library output

I'm trying to build a React JS app from Typescript sources, built with Bazel and using Webpack as the bundler. rules_nodejs includes examples/react_webpack, which shows how to do it using ts_project, but I need to build it using ts_library because…
simmonmt
  • 31
  • 3
0
votes
0 answers

Passing absolute path to a directory from genrule in a Bazel BUILD file

I'm trying to set an environment variable for my mocha_test rule in a Bazel BUILD file to provide the absolute path to a directory that's created using a genrule. The genrule is responsible for creating the directory and processing some…
rakib
  • 131
  • 3
  • 10
0
votes
1 answer

Bazel reload times very slow using Angular

Running an Angular project with 20+ separate modules and the reload times after making any simple change are 10s+ for each module. Using incremental builds so only effected modules are rebuilt, but the times are a bottleneck to development. Any…
0
votes
0 answers

Control the execution order of Bazel repository rules

Is it possible to ensure a Bazel repository rule gets executed before another repository rule in WORKSPACE? Our team is using repository rule yarn_install to download NPM packages in CI environment. Recently we want to use another repository rule to…
Hang Yin
  • 21
  • 2
0
votes
1 answer

Using SWC with Bazel

I'm trying to compile my TS files to JS with SWC in Bazel. I'm unfortunately unable to use the rules_js library (which has rules_swc), so I need to hand roll it. So far I have: load("@npm//@swc/cli:index.bzl", "swc") SRC_FILES =…
0
votes
1 answer

How can I configure nodejs rollup in bazel a workspace with multiple npm packages?

I am trying to sort out how to correctly use rollup_bundle() in bazel in a workspace using multiple languages, including JavaScript, and defining multiple npm packages in different directories. It appears that the rollup bazel rules assume a more…
mdittmer
  • 534
  • 3
  • 9
0
votes
1 answer

`Bazel run` won't find static file dependency in bazel-bin when running nodejs_image

I am trying to get a rules docker nodejs_image to run using bazel. My command is bazel run :image.binary Here is my rule: load("@npm//@bazel/typescript:index.bzl", "ts_project") load("@io_bazel_rules_docker//nodejs:image.bzl",…
Cameron
  • 2,805
  • 3
  • 31
  • 45
0
votes
1 answer

How to access node_modules folder after running yarn_install (or npm_install ) in rules_nodejs bazel?

I'm relatively new to Bazel but this has taken longer than I felt it should. I am doing yarn_install in my workspace, and I am just trying to reference the installed node_modules so that I can put them in my new docker…
Cameron
  • 2,805
  • 3
  • 31
  • 45
0
votes
1 answer

Cannot use import statement outside a module (Bazel + Concatjs + NgRx)

The Issue I am using Bazel to build my Angular application. Everything works fine with NgRx version 9. But after upgrading NgRx to v10 or greater, the Angular development server breaks with this error: Uncaught SyntaxError: Cannot use import…
Florian Ludewig
  • 4,338
  • 11
  • 71
  • 137
0
votes
1 answer

Checking if an array of package.json dependency is sorted in alphanumeric order in typeScript

I want to check if an array of package.json dependencies and devDependencies are sorted in alphanumeric order in typeScript. If it is not sorted then it should return the dep name which is falling out of place. I want to build a bazel rule checking…
0
votes
1 answer

Angular bazel ts_devserver add polyfills

ts_devserver( name = "devserver", additional_root_paths = ["project/src/_"], entry_module = "project/src/main.dev", port = 4200, scripts = [ "@npm//:node_modules/tslib/tslib.js", …
Serginho
  • 7,291
  • 2
  • 27
  • 52
-1
votes
1 answer

Copy a directory to a new directory in Bazel

essentially all I want is cp -r src/ dist/, but for some reason I simply cannot get this to work. Currently I am trying: filegroup( name = "src_files", srcs = glob([ "src/**", ]), ) filegroup( name = "dist_files", srcs =…
Jon L
  • 27
  • 4
1
2