Product
Introducing SSO
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
remix-vite
Advanced tools
Readme
remix-vite
helps you serve Remix apps locally using Vite.
The quickest way to get started is to just run npx remix-vite
in your project's directory.
If you prefer, you can also install the package globally (you'll need at least Node LTS):
> npm install --global remix-vite
Once that's done, you can run this command inside your project's directory...
> remix-vite
Now you understand how the package works! :tada:
If you want to use remix-vite
with a custom remix server, you can do so by integrating your server with vite dev server.
Let's say you have a custom Express server and you want to use it with remix-vite
. Here is how you can do it:
const express = require('express');
const { createRequestHandler } = require('@remix-run/express');
const { createRemixViteDevServer, getRemixViteBuild } = require('remix-vite');
const app = express();
// Create a remix-vite dev server.
createRemixViteDevServer().then((remixViteDevServer) => {
// Use remix-vite dev server as middleware.
app.use(remixViteDevServer.middlewares);
app.all('*', async (req, res, next) => {
purgeRequireCache();
// Get the remix build generated by remix-vite.
const remixBuild = await getRemixViteBuild(remixViteDevServer);
// Create a remix express request handler.
const requestHandler = createRequestHandler({ build: remixBuild });
await requestHandler(req, res, next);
});
// Start the server.
app.listen(3000, () => {
console.log('Listening at http://localhost:3000');
});
});
function purgeRequireCache() {
// purge require cache on requests for "server side HMR" this won't let
// you have in-memory objects between requests in development.
for (const key in require.cache) {
delete require.cache[key];
}
}
If you want to change the host and port just pass --host and --port flag to remix-vite. Default host is localhost
and port is 3000
> remix-vite --port=4000
If you want a feature to be added, or wish to report a bug, please open an issue here.
Mayke Freitas (@sudomf)
FAQs
Static file serving and directory listing
The npm package remix-vite receives a total of 10 weekly downloads. As such, remix-vite popularity was classified as not popular.
We found that remix-vite demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.