Skip to content

Commit

Permalink
ui: resolve list.js dependency for Db Console bazel build
Browse files Browse the repository at this point in the history
Currently, to manage proper JS dependency resolution with bazel,
we need to do one more extra step (which isn't automated yet):
explicitly specify the list of dependencies required by Db Console
in its BUILD.bazel file.

Another issue that is solved with this change is path resolution for
"node_modules" in Webpack config file. Path resolution for NPM modules
in webpack relies on project structure and it doesn't work well with
the way bazel places outputs.

Release note: None
  • Loading branch information
koorosh committed Jan 20, 2022
1 parent b239367 commit 73caccf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
1 change: 1 addition & 0 deletions pkg/ui/workspaces/db-console/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ DEPENDENCIES = [
"@npm//highlight.js",
"@npm//lodash",
"@npm//long",
"@npm//list.js",
"@npm//mini-create-react-context",
"@npm//moment",
"@npm//nvd3",
Expand Down
7 changes: 3 additions & 4 deletions pkg/ui/workspaces/db-console/webpack.app.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,11 @@ module.exports = (env, argv) => {
new RemoveBrokenDependenciesPlugin(),
new CopyWebpackPlugin([
{ from: path.resolve(__dirname, "favicon.ico"), to: "favicon.ico" },
]),
new CopyWebpackPlugin([
{
from: path.resolve(
__dirname,
"../../node_modules/list.js/dist/list.min.js",
!isBazelBuild ? __dirname : "",
!isBazelBuild ? "../.." : "",
"node_modules/list.js/dist/list.min.js",
),
to: path.resolve(__dirname, "../../dist_vendor/list.min.js"),
},
Expand Down

0 comments on commit 73caccf

Please sign in to comment.