0.1.0 • Published 1 year ago

@lamsal-de/vite-plugin-remix-server-bundle v0.1.0

Weekly downloads
-
License
ISC
Repository
-
Last release
1 year ago

vite-plugin-remix-server-bundle

Use this plugin to create a build/server.js when building your app which can be executed via PORT=1234 node build/server.js, without installing any deps first.

Install

pnpm add @lamsal-de/vite-plugin-remix-server-bundle

Usage

Add the plugin to your vite.config.ts. After building via vite, you can run your build/server.js file by setting the PORT env variable first.

Given you are using remix, this is the minimal config:

import { vitePlugin as remix } from "@remix-run/dev"
import { defineConfig } from "vite"
import { remixServerBundle } from "@lamsal-de/vite-plugin-remix-server-bundle"

export default defineConfig({
    plugins: [
        remix(),
        remixServerBundle()
    ],
})

How

No configuration; when adding this plugin to your vite.config.ts#plugins array (after the remix plugin) you will get an additional file build/server.js in your build directory which is the bundled and ready-to-go entrypoint for your remix app.

This is achieved by bundling a file which creates an express server which serves the remix app, using remix' express adapter.

0.1.0

1 year ago

0.0.6

1 year ago

0.0.5

1 year ago

0.0.4

1 year ago

0.0.3

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago