Replies: 5 comments 1 reply
-
My favorite tool for this kind of questions: https://grep.app/search?current=3&q=%40remix-run/dev/ Here are some relevant hits in the open, including remix-vite & remix-flat-routes import type { RemixConfig } from '@remix-run/dev/dist/config';
import type { ConfigRoute } from '@remix-run/dev/dist/config/routes';
import { getRouteModuleExports } from '@remix-run/dev/dist/compiler/routeExports';
import { defineRoutes } from '@remix-run/dev/config/routes' |
Beta Was this translation helpful? Give feedback.
-
From my side I don't depend on I like the idea to bundle the dev package, I think this installs many other dependencies right now but bundling them in a single (or a few) JS file(s) should help keep node_modules smaller. |
Beta Was this translation helpful? Give feedback.
-
Only one I can think of right now is the build import in the import * as build from "@remix-run/dev/server-build"; |
Beta Was this translation helpful? Give feedback.
-
One way you could do this is by using the built-in |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
We should bundle everything we can in the production build of remix-dev. The current way it is built is not optimal and was just done so we could have something that worked.
Goals
npx
, i.e.npx @remix-run/dev ...
Deep Imports
Some folks are deep-importing from
@remix-run/dev
. However, when we bundle it we won't have separate files in the@remix-run/dev
npm package anymore, i.e. the file structure of the@remix-run/dev
package will change. Instead of separate files in the Rollup output, we'll likely have a singleindex.js
script.Although we do not consider this to be a breaking change (we do not support deep imports in any of our packages) we would like to make sure that users who are deep importing from
@remix-run/dev
have a path forward after this work ships. As far as I can tell, the main thing people are importing isloadConfig
. We could expose this on the public interface of@remix-run/dev
like this:I'd love to hear from anyone else who is deep importing something from
@remix-run/dev
to see if we can also support them. If you are doing this, please comment in this proposal. /cc @sergiodxa @kiliman @MichaelDeBoey Are you aware of anyone who is doing this?In addition, after we make this change we should use package.json's
exports
field to make our exports in@remix-run/dev
explicit.Implementation Notes
/cc @jacob-ebey for feedback on this proposal 🙏
Beta Was this translation helpful? Give feedback.
All reactions