Skip to content

Conversation

@TooTallNate
Copy link
Contributor

This adds the ability to split up the server-side build into multiple bundles via a new config property: serverBundles.

Example:

  serverBundles: [
    { serverBuildPath: 'build/build1.js', routes: ['routes/index', 'routes/about'] },
    { serverBuildPath: 'build/build2.js', routes: ['routes/generate', 'routes/error'] }
  ],

When serverBundles is defined, it takes precedence over the top-level serverBuildPath property, since each "bundle" entry can define its output file path.

Related to Discussion: #5405

  • Docs
  • Tests

I will add docs / tests if this proposal is agreed upon.

Testing Strategy:

Closes: #

  • Docs
  • Tests

Testing Strategy:

…server bundles

This adds the ability to split up the server-side build into multiple bundles via a new config property: `serverBundles`.

Example:

```js
  serverBundles: [
    { serverBuildPath: 'build/build1.js', routes: ['routes/index', 'routes/about'] },
    { serverBuildPath: 'build/build2.js', routes: ['routes/generate', 'routes/error'] }
  ],
```

When `serverBundles` is defined, it takes precedence over the top-level `serverBuildPath` property, since each "bundle" entry can define its output file path.

Related to Discussion: [remix-run#5405](remix-run#5405 (comment))

- [ ] Docs
- [ ] Tests

I will add docs / tests if this proposal is agreed upon.

Testing Strategy:

<!--
Please explain how you tested this. For example:

> This test covers this code: <link to test>

Or

> I opened up my windows machine and ran this script:
>
> ```
> npx [email protected] --template remix my-test
> cd my-test
> npm run dev
> ```
-->
@remix-cla-bot
Copy link
Contributor

remix-cla-bot bot commented Aug 9, 2023

Hi @TooTallNate,

Welcome, and thank you for contributing to Remix!

Before we consider your pull request, we ask that you sign our Contributor License Agreement (CLA). We require this only once.

You may review the CLA and sign it by adding your name to contributors.yml.

Once the CLA is signed, the CLA Signed label will be added to the pull request.

If you have already signed the CLA and received this response in error, or if you have any questions, please contact us at [email protected].

Thanks!

- The Remix team

@changeset-bot
Copy link

changeset-bot bot commented Aug 9, 2023

🦋 Changeset detected

Latest commit: 5968bf2

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 16 packages
Name Type
@remix-run/dev Minor
create-remix Minor
remix Minor
@remix-run/architect Minor
@remix-run/cloudflare Minor
@remix-run/cloudflare-pages Minor
@remix-run/cloudflare-workers Minor
@remix-run/css-bundle Minor
@remix-run/deno Minor
@remix-run/eslint-config Minor
@remix-run/express Minor
@remix-run/node Minor
@remix-run/react Minor
@remix-run/serve Minor
@remix-run/server-runtime Minor
@remix-run/testing Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@remix-cla-bot
Copy link
Contributor

remix-cla-bot bot commented Aug 9, 2023

Thank you for signing the Contributor License Agreement. Let's get this merged! 🥳

@MichaelDeBoey MichaelDeBoey changed the title feat(dev): Add support for serverBundles config to output multiple server bundles feat(remix-dev): add serverBundles config option Aug 10, 2023
@MichaelDeBoey
Copy link
Member

Server Bundles are now possible in the stable Vite plugin 🥳🎉

https://remix.run/blog/remix-vite-stable#server-bundles

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants