File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -70,7 +70,12 @@ function main(params) {
7070 }
7171 }
7272
73- for ( const f of params ) {
73+ // Remove duplicate files (which may come from this rule) from the
74+ // list since fs.copyFileSync may fail with `EACCES: permission denied`
75+ // as it will not have permission to overwrite duplicate files that were
76+ // copied from within bazel-bin.
77+ // See https://github.com/bazelbuild/rules_nodejs/pull/546.
78+ for ( const f of new Set ( params ) ) {
7479 copy ( f ) ;
7580 }
7681 return 0 ;
Original file line number Diff line number Diff line change 1- load ("@build_bazel_rules_nodejs//:defs.bzl" , "jasmine_node_test" )
1+ load ("@build_bazel_rules_nodejs//:defs.bzl" , "jasmine_node_test" , "rollup_bundle" )
22load ("@build_bazel_rules_nodejs//internal/web_package:web_package.bzl" , "web_package" )
33
4+ rollup_bundle (
5+ name = "bundle" ,
6+ srcs = glob (["*.js" ]),
7+ entry_point = "internal/web_package/test/script.js" ,
8+ )
9+
410web_package (
511 name = "pkg" ,
6- assets = ["script.js" ],
12+ # Intentionally duplicating `bundle.min.js` in assets and data
13+ # to test for regression of the issues fixed by
14+ # https://github.com/bazelbuild/rules_nodejs/pull/546
15+ assets = [":bundle.min.js" ],
16+ data = [":bundle" ],
717 index_html = "index.html" ,
818)
919
Original file line number Diff line number Diff line change 11<html><head></head><body>
2- <script type="text/javascript" src="/script .js?v=123"></script></body></html>
2+ <script type="text/javascript" src="/bundle.min .js?v=123"></script></body></html>
You can’t perform that action at this time.
0 commit comments