Skip to content

Commit

Permalink
🐛added optional extention matching for dependency remap when bundling (
Browse files Browse the repository at this point in the history
…ampproject#37676)

* added optional extention matching for dependency remap when bundling

* Update build-system/tasks/helpers.js

Co-authored-by: Jake Fried <samouri@users.noreply.github.com>

* Update build-system/tasks/helpers.js

Co-authored-by: Alan Orozco <alanorozco@users.noreply.github.com>

Co-authored-by: Jake Fried <samouri@users.noreply.github.com>
Co-authored-by: Alan Orozco <alanorozco@users.noreply.github.com>
  • Loading branch information
3 people authored Feb 14, 2022
1 parent 2b675ca commit 42cc51f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion build-system/tasks/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,10 @@ async function esbuildCompile(srcDir, srcFilename, destDir, options) {
*/
function remapDependenciesPlugin() {
const remaps = Object.entries(options.remapDependencies).map(
([path, value]) => ({regex: new RegExp(`^${path}$`), value})
([path, value]) => ({
regex: new RegExp(`^${path}(\.js|\.jsx|\.ts|\.tsx)?$`),
value,
})
);
const external = options.externalDependencies;
return {
Expand Down

0 comments on commit 42cc51f

Please sign in to comment.