Укажите базовый href в приложении angular, используя bazel - PullRequest
1 голос
/ 15 января 2020

Я пытаюсь добавить bazel в приложение angular, но у меня все еще возникают проблемы при попытке приложения указать URL-адрес c. То, что у меня было раньше, было:

ng serve --host 0.0.0.0 --public-host http://localhost:4200/ --poll=500 --base-href /app/ --serve-path /app/

Я хотел сделать то же самое с помощью Bazel, но мне не удалось это сделать. На ts_devserver я сделал:

ts_devserver(
    name = "devserver",
    # Serve src/example/index.html at /index.html
    additional_root_paths = ["src/example"],
    # Run the program from the development version of the main
    entry_module = "project/src/main.dev",
    # These scripts will be included in the JS bundle after require.js
    # They should have only named UMD modules, or require.js will throw.
    scripts = [
        "@npm//:node_modules/tslib/tslib.js",
        ":rxjs_umd_modules",
        # We are manaully adding the bazel generated named-UMD date-fns bundle here as
        # named-UMD bundles for non-APF npm packages are not yet automatically added.
        # This file is generated by the npm_umd_bundle @npm//date-fns:date-fns__umd
        # rule that is setup by yarn_install.
        # "@npm//date-fns:date-fns.umd.js",
    ],
    port = 4200,
    serving_path = "/app/",
    # Serve these files in addition to the JavaScript bundle
    static_files = _ASSETS + [
        ":inject_scripts_for_dev",
    ],
    # Tell Bazel to build the sources first
    deps = ["//src"],
)

И по моему индексу. html У меня есть <base href="/app/" />

Какая конфигурация отсутствует, чтобы я мог обслуживать свое приложение в localhost / app?

Спасибо.

...