load("@npm//webpack-cli:index.bzl", "webpack_cli") load("@build_bazel_rules_nodejs//:index.bzl", "js_library") SRCS = glob( [ "src/**/*", "index.ts", "server.ts", ], exclude = [ "**/*.config.js", "**/*.mock.*", "**/*.test.*", "**/*.stories.*", "**/__jest_/**", "**/__snapshots__/**", "**/integration_tests/**", "**/mocks/**", "**/scripts/**", "**/storybook/**", "**/test_fixtures/**", "**/test_helpers/**", ], ) SHARED_DEPS = [ "//packages/kbn-i18n", "//packages/kbn-ui-theme", "@npm//antlr4ts", "@npm//monaco-editor", "@npm//monaco-yaml", ] webpack_cli( name = "target_workers", data = SRCS + SHARED_DEPS + [ "//:.browserslistrc", "//packages/kbn-babel-preset", "@npm//@babel/runtime", "@npm//babel-loader", "@npm//raw-loader", "@npm//rxjs", "webpack.config.js", ], output_dir = True, args = [ "--config", "$(location webpack.config.js)", "--output-path", "$(@D)", "--env", "prod", "--stats=errors-only" ], env = select({ "//:dist": { "NODE_ENV": "production", "NODE_OPTIONS": "--openssl-legacy-provider", }, "//conditions:default": { "NODE_ENV": "development", "NODE_OPTIONS": "--openssl-legacy-provider", }, }), visibility = ["//visibility:public"], ) js_library( name = "kbn-monaco", package_name = "@kbn/monaco", srcs = ["package.json"] + SRCS, deps = SHARED_DEPS, visibility = ["//visibility:public"], )