-
Notifications
You must be signed in to change notification settings - Fork 522
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(builtin): additional_root_paths in pkg_web should also include paths in genfiles and bin dirs #1402
Merged
gregmagolan
merged 1 commit into
bazel-contrib:master
from
gregmagolan:pkg_web_additional_root_paths_fix
Nov 27, 2019
Merged
fix(builtin): additional_root_paths in pkg_web should also include paths in genfiles and bin dirs #1402
gregmagolan
merged 1 commit into
bazel-contrib:master
from
gregmagolan:pkg_web_additional_root_paths_fix
Nov 27, 2019
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…ths in genfiles and bin dirs This allows generating an index.html file into a different folder in the output tree (so that it doesn't collide within put index.html file) and then re-mapping the output in pkg_web back to /index.html. ts_devserver already supports this via additional_root_paths so this brings the same functionality to pkg_web. It is useful for the case where you have a single input index.html file and you inject scripts tags and output to a dir such as _/index.html and consume the output in both ts_devserver & pkg_web. For example, ``` html_insert_assets( name = "inject_scripts", # We can't output "index.html" since that collides with the input file. # We output "_/index.html" instead ond remap in ts_devserver & pkg_web # using additional_root_paths. outs = ["_/index.html"], args = [ "--html", "$(location :index.html)", "--out", "$@", "--assets", # We load zone.js outside the bundle. That's because it's a "pollyfill" # which speculates that such features might be available in a browser. # Also it's tricky to configure dead code elimination to understand that # zone.js is used, given that we don't have any import statement that # imports from it. "$(location @npm//:node_modules/zone.js/dist/zone.min.js)", # Bundle path for both prodapp & devserver "bundle.min.js", ], data = [ ":index.html", "@npm//:node_modules/zone.js/dist/zone.min.js", ], ) ts_devserver( name = "devserver", # Remap "_/index.html" => "index.html" additional_root_paths = ["src/_"], entry_module = "bazel_integration_test/src/main", scripts = [ ":rxjs_umd_modules", ], # Use the same bundle serving path as prodserver so that we can share # an index.html file. serving_path = "/bundle.min.js", static_files = [ ":inject_scripts", "@npm//:node_modules/zone.js/dist/zone.min.js", ], deps = ["//src"], ) rollup_bundle( name = "bundle", config_file = "rollup.config.js", entry_point = ":main.ts", deps = [ "//src", "@npm//rollup-plugin-commonjs", "@npm//rollup-plugin-node-resolve", ], ) terser_minified( name = "bundle.min", src = ":bundle", ) pkg_web( name = "prodapp", # Remap "_/index.html" => "index.html" additional_root_paths = ["src/_"], srcs = [ ":inject_scripts", "@npm//:node_modules/zone.js/dist/zone.min.js", ":bundle.min", ], ) http_server( name = "prodserver", data = [":prodapp"], templated_args = ["src/prodapp"], ) ```
alexeagle
approved these changes
Nov 27, 2019
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note, genfiles_dir is now same as bin_dir (pending some flag flip?)
Yeah. I figured it would be so this will get cleanup up with the rest of the |
14 tasks
gregmagolan
added a commit
to gregmagolan/angular
that referenced
this pull request
Dec 5, 2019
This release brings two bug fixes we're waiting on: 1) fix(builtin): additional_root_paths in pkg_web should also include paths in genfiles and bin dirs (bazel-contrib/rules_nodejs#1402), which is a pre-req for angular#34112 2) fix(typescript): fix for cross platform ts_devserver issue angular#1409 (bazel-contrib/rules_nodejs#1413) which resolves ts_devserver launcher template is platform specific angular#1409 (bazel-contrib/rules_nodejs#1409) --- this fixes an OSX developer workflow with --config=remote This does not upgrade integration/bazel or integation/schematics. That will be done in another PR.
14 tasks
gregmagolan
added a commit
to gregmagolan/angular
that referenced
this pull request
Dec 5, 2019
…nodejs 0.42.1 This release brings a bug fix that angular#34243 is waiting on in order to remove rules_nodejs patches: fix(builtin): additional_root_paths in pkg_web should also include paths in genfiles and bin dirs (bazel-contrib/rules_nodejs#1402)
gregmagolan
added a commit
to gregmagolan/angular
that referenced
this pull request
Dec 5, 2019
…nodejs 0.42.1 This release brings a bug fix that angular#34243 is waiting on in order to remove rules_nodejs patches: fix(builtin): additional_root_paths in pkg_web should also include paths in genfiles and bin dirs (bazel-contrib/rules_nodejs#1402)
gregmagolan
added a commit
to gregmagolan/angular
that referenced
this pull request
Dec 5, 2019
…nodejs 0.42.1 This release brings a bug fix that angular#34243 is waiting on in order to remove rules_nodejs patches: fix(builtin): additional_root_paths in pkg_web should also include paths in genfiles and bin dirs (bazel-contrib/rules_nodejs#1402)
AndrewKushnir
pushed a commit
to angular/angular
that referenced
this pull request
Dec 5, 2019
This release brings two bug fixes we're waiting on: 1) fix(builtin): additional_root_paths in pkg_web should also include paths in genfiles and bin dirs (bazel-contrib/rules_nodejs#1402), which is a pre-req for #34112 2) fix(typescript): fix for cross platform ts_devserver issue #1409 (bazel-contrib/rules_nodejs#1413) which resolves ts_devserver launcher template is platform specific #1409 (bazel-contrib/rules_nodejs#1409) --- this fixes an OSX developer workflow with --config=remote This does not upgrade integration/bazel or integation/schematics. That will be done in another PR. PR Close #34243
AndrewKushnir
pushed a commit
to angular/angular
that referenced
this pull request
Dec 5, 2019
This release brings two bug fixes we're waiting on: 1) fix(builtin): additional_root_paths in pkg_web should also include paths in genfiles and bin dirs (bazel-contrib/rules_nodejs#1402), which is a pre-req for #34112 2) fix(typescript): fix for cross platform ts_devserver issue #1409 (bazel-contrib/rules_nodejs#1413) which resolves ts_devserver launcher template is platform specific #1409 (bazel-contrib/rules_nodejs#1409) --- this fixes an OSX developer workflow with --config=remote This does not upgrade integration/bazel or integation/schematics. That will be done in another PR. PR Close #34243
josephperrott
pushed a commit
to josephperrott/angular
that referenced
this pull request
Dec 11, 2019
This release brings two bug fixes we're waiting on: 1) fix(builtin): additional_root_paths in pkg_web should also include paths in genfiles and bin dirs (bazel-contrib/rules_nodejs#1402), which is a pre-req for angular#34112 2) fix(typescript): fix for cross platform ts_devserver issue angular#1409 (bazel-contrib/rules_nodejs#1413) which resolves ts_devserver launcher template is platform specific angular#1409 (bazel-contrib/rules_nodejs#1409) --- this fixes an OSX developer workflow with --config=remote This does not upgrade integration/bazel or integation/schematics. That will be done in another PR. PR Close angular#34243
josephperrott
pushed a commit
to josephperrott/angular
that referenced
this pull request
Dec 11, 2019
…nodejs 0.42.1 This release brings a bug fix that angular#34243 is waiting on in order to remove rules_nodejs patches: fix(builtin): additional_root_paths in pkg_web should also include paths in genfiles and bin dirs (bazel-contrib/rules_nodejs#1402)
kara
pushed a commit
to angular/angular
that referenced
this pull request
Dec 11, 2019
…nodejs 0.42.1 (#34112) This release brings a bug fix that #34243 is waiting on in order to remove rules_nodejs patches: fix(builtin): additional_root_paths in pkg_web should also include paths in genfiles and bin dirs (bazel-contrib/rules_nodejs#1402) PR Close #34112
kara
pushed a commit
to angular/angular
that referenced
this pull request
Dec 11, 2019
…nodejs 0.42.1 (#34112) This release brings a bug fix that #34243 is waiting on in order to remove rules_nodejs patches: fix(builtin): additional_root_paths in pkg_web should also include paths in genfiles and bin dirs (bazel-contrib/rules_nodejs#1402) PR Close #34112
gregmagolan
added a commit
to gregmagolan/angular
that referenced
this pull request
Dec 28, 2019
…nodejs 0.42.1 This release brings a bug fix that angular#34243 is waiting on in order to remove rules_nodejs patches: fix(builtin): additional_root_paths in pkg_web should also include paths in genfiles and bin dirs (bazel-contrib/rules_nodejs#1402)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This allows generating an index.html file into a different folder in the output tree (so that it doesn't collide within put index.html file) and then re-mapping
the output in pkg_web back to /index.html. ts_devserver already supports this via additional_root_paths so this brings the same functionality to pkg_web.
It is useful for the case where you have a single input index.html file and you inject scripts tags and output to a dir such as _/index.html and consume the output in both ts_devserver & pkg_web. For example,