Here's a simple use case where I would like to copy an external folder from our node_modules:
<npm_pkg_dir>/dist/fonts => <package_name>/material-design-icons-iconfont.
Currently, I seem to be unable to figure out which combinations of props will give me the desired result. Let's say I use the package material-design-icons-iconfont@6.7.0 the prefix would need to be hardcoded:
Currently:
copy_to_directory(
name = "material-design-icons",
srcs = [
"//:node_modules/material-design-icons-iconfont/dir",
],
out = "material-design-icons-iconfont",
replace_prefixes = {
# copies an empty `node_modules` folder, not sure where this comes from
"node_modules": "",
# would expect to use $(location ...) here
"node_modules/.aspect_rules_js/material-design-icons-iconfont@6.7.0/node_modules/material-design-icons-iconfont/dist/fonts": "",
},
)
Expected:
copy_to_directory(
name = "material-design-icons",
srcs = [
"//:node_modules/material-design-icons-iconfont/dir",
],
out = "material-design-icons-iconfont",
replace_prefixes = {
"$(location //:node_modules/material-design-icons-iconfont/dir)/dist/fonts": "",
},
)
# or
copy_to_directory(
name = "material-design-icons",
srcs = [
"//:node_modules/material-design-icons-iconfont/dir",
],
out = "material-design-icons-iconfont",
root_paths = [
"$(location //:node_modules/material-design-icons-iconfont/dir)",
],
replace_prefixes = {
"dist/fonts": "",
},
)
Describe the feature
I would like to avoid having to compute the path to strip or hardcoding the value. Possibly there is a better way to approach this copy operation? I have tried using root_paths as well with no success, either way, it would be great to have a convenient way of performing this operation.
Fund our work
[ ] Sponsor our open source work by donating a feature bounty
What is the current behavior?
Here's a simple use case where I would like to copy an external folder from our
node_modules
:<npm_pkg_dir>/dist/fonts
=><package_name>/material-design-icons-iconfont
.Currently, I seem to be unable to figure out which combinations of props will give me the desired result. Let's say I use the package
material-design-icons-iconfont@6.7.0
the prefix would need to be hardcoded:Currently:
Expected:
Describe the feature
I would like to avoid having to compute the path to strip or hardcoding the value. Possibly there is a better way to approach this copy operation? I have tried using
root_paths
as well with no success, either way, it would be great to have a convenient way of performing this operation.Fund our work