Open woody146 opened 12 months ago
Remix only processes *.server and *.client modules for files in the app
folder.
You'd need to patch Remix if you want it to handle other folders.
patches/@remix-run+dev+2.0.1.patch
diff --git a/node_modules/@remix-run/dev/dist/compiler/plugins/emptyModules.js b/node_modules/@remix-run/dev/dist/compiler/plugins/emptyModules.js
index c33acaa..7f72af8 100644
--- a/node_modules/@remix-run/dev/dist/compiler/plugins/emptyModules.js
+++ b/node_modules/@remix-run/dev/dist/compiler/plugins/emptyModules.js
@@ -53,7 +53,9 @@ function emptyModulesPlugin({
// Limit this behavior to modules found in only the `app` directory.
// This allows node_modules to use the `.server.js` and `.client.js`
// naming conventions with different semantics.
- path__namespace.resolve(args.resolveDir, args.path).startsWith(config.appDirectory)) {
+ path__namespace.resolve(args.resolveDir, args.path).startsWith(config.appDirectory) ||
+ path__namespace.resolve(args.resolveDir, args.path).startsWith(config.appDirectory.replace('/app', '/src'))
+ ) {
return {
path: args.path,
namespace: "empty-module"
// empty-module:./phaser.client
var require_phaser = __commonJS({
"empty-module:./phaser.client"(exports, module) {
module.exports = {};
}
});
Thank you for the solution, but I think remix should add config for this
What version of Remix are you using?
2.01
Are all your remix dependencies & dev-dependencies using the same version?
Steps to Reproduce
Define custom routes in
remix.config.js
File
src/test.tsx
File
phaser.client.tsx
Expected Behavior
File
build/index.js
doesn't contain source code ofsrc/phaser.client.tsx
Actual Behavior
File
build/index.js
contains source code ofsrc/phaser.client.tsx