Skip to content

Commit

Permalink
[windows] Add Windows compatibility for the resolve ESBuild plugin (#…
Browse files Browse the repository at this point in the history
…461)

* [windows] Add Windows compatibility for the `resolve` ESBuild plugin

Previously, the separator for the filter regex was hardcoded to / (Unix separator).

Now, we're also taking account for the \ (Windows separator) in the filter regex.

Signed-off-by: Costin Sin <sin.costinrobert@gmail.com>

* Create popular-kids-beam.md

---------

Signed-off-by: Costin Sin <sin.costinrobert@gmail.com>
Co-authored-by: conico974 <nicodorseuil@yahoo.fr>
  • Loading branch information
costinsin and conico974 committed Jul 8, 2024
1 parent e2d0c7f commit ab0f8b2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/popular-kids-beam.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"open-next": patch
---

[windows] Add Windows compatibility for the `resolve` ESBuild plugin
2 changes: 1 addition & 1 deletion packages/open-next/src/plugins/resolve.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export function openNextResolvePlugin({
name: "opennext-resolve",
setup(build) {
logger.debug(`OpenNext Resolve plugin for ${fnName}`);
build.onLoad({ filter: /core\/resolve.js/g }, async (args) => {
build.onLoad({ filter: /core(\/|\\)resolve\.js/g }, async (args) => {
let contents = readFileSync(args.path, "utf-8");
//TODO: refactor this. Every override should be at the same place so we can generate this dynamically
if (overrides?.wrapper) {
Expand Down

0 comments on commit ab0f8b2

Please sign in to comment.