-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Patch @remix-run/dev to allow watching changes on packages
The solution is here: remix-run/remix#1193 (comment) And for patching a npm package is this package: https://www.npmjs.com/package/patch-package Which doesn'r work with pnpm LOL. Patched itself here: ds300/patch-package#302 (comment)
- Loading branch information
1 parent
ec1608f
commit 013b0e5
Showing
3 changed files
with
142 additions
and
3 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# generated by patch-package 6.4.8 on 2022-03-07 16:06:40 | ||
# | ||
# command: | ||
# npx patch-package @remix-run/dev | ||
# | ||
# declared package: | ||
# @remix-run/dev: ^1.2.3 | ||
# | ||
diff --git a/node_modules/@remix-run/dev/compiler.js b/node_modules/@remix-run/dev/compiler.js | ||
index 9bbf9b1..e976656 100644 | ||
--- a/node_modules/@remix-run/dev/compiler.js | ||
+++ b/node_modules/@remix-run/dev/compiler.js | ||
@@ -204,6 +204,10 @@ async function watch(config$1, { | ||
}, 100); | ||
let toWatch = [config$1.appDirectory]; | ||
|
||
+ if (config$1.watchGlobs) { | ||
+ toWatch = toWatch.concat(config$1.watchGlobs); | ||
+ } | ||
+ | ||
if (config$1.serverEntryPoint) { | ||
toWatch.push(config$1.serverEntryPoint); | ||
} | ||
diff --git a/node_modules/@remix-run/dev/config.d.ts b/node_modules/@remix-run/dev/config.d.ts | ||
index df065bd..76a4a2d 100644 | ||
--- a/node_modules/@remix-run/dev/config.d.ts | ||
+++ b/node_modules/@remix-run/dev/config.d.ts | ||
@@ -108,6 +108,10 @@ export interface AppConfig { | ||
* in a CJS build. | ||
*/ | ||
serverDependenciesToBundle?: Array<string | RegExp>; | ||
+ /** | ||
+ * An array of paths to watch for changes. | ||
+ */ | ||
+ watchGlobs?: string[]; | ||
} | ||
/** | ||
* Fully resolved configuration object we use throughout Remix. | ||
diff --git a/node_modules/@remix-run/dev/config.js b/node_modules/@remix-run/dev/config.js | ||
index 6d76739..abc0b5b 100644 | ||
--- a/node_modules/@remix-run/dev/config.js | ||
+++ b/node_modules/@remix-run/dev/config.js | ||
@@ -197,6 +197,7 @@ async function readConfig(remixRoot, serverMode = serverModes.ServerMode.Product | ||
serverBuildTargetEntryModule, | ||
serverEntryPoint: customServerEntryPoint, | ||
serverDependenciesToBundle, | ||
+ watchGlobs: appConfig.watchGlobs || [], | ||
mdx | ||
}; | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.