Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@hono/vite-dev-server

Package Overview
Dependencies
Maintainers
1
Versions
46
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@hono/vite-dev-server - npm Package Compare versions

Comparing version 0.0.1 to 0.0.2

README.md

2

dist/dev-server.d.ts

@@ -0,1 +1,2 @@

import { WorkerOptions } from 'miniflare';
import { Plugin } from 'vite';

@@ -6,2 +7,3 @@

injectClientScript?: boolean;
cf?: Partial<Omit<WorkerOptions, 'name' | 'script' | 'scriptPath' | 'modules' | 'modulesRoot' | 'modulesRules'>>;
};

@@ -8,0 +10,0 @@ declare function devServer(options?: DevServerOptions): Plugin[];

2

dist/dev-server.js

@@ -1,1 +0,1 @@

import{getRequestListener as f}from"@hono/node-server";function g(r){const n=r?.entry??"./src/index.ts";return[{name:"sonik-dev-server",config:()=>({build:{rollupOptions:{input:[n]}}}),configureServer:async s=>{async function c(u){return async function(t,p,i){if(t.url?.endsWith(".ts")||t.url?.endsWith(".tsx")||t.url?.startsWith("/@")||t.url?.startsWith("/node_modules"))return i();const o=(await u.ssrLoadModule(n)).default;if(!o)return console.error(`Failed to find a named export "default" from ${n}`),i();f(async d=>{const e=await o.fetch(d);if(r?.injectClientScript!==!1&&!e.headers.get("transfer-encoding")?.match("chunked")&&e.headers.get("content-type")?.match(/^text\/html/)){const l=await e.text()+'<script type="module" src="/@vite/client"></script>',a=new Headers(e.headers);return a.delete("content-length"),new Response(l,{status:e.status,headers:a})}return e})(t,p)}}s.middlewares.use(await c(s))}}]}export{g as devServer};
import{getRequestListener as f}from"@hono/node-server";import{Miniflare as h}from"miniflare";const v='addEventListener("fetch", (event) => event.respondWith(new Response(null, { status: 404 })));';function x(n){const r=n?.entry??"./src/index.ts";return[{name:"sonik-dev-server",config:()=>({build:{rollupOptions:{input:[r]}}}),configureServer:async s=>{const c=new h({script:v,...n?.cf});async function p(u){return async function(t,l,i){if(t.url?.endsWith(".ts")||t.url?.endsWith(".tsx")||t.url?.startsWith("/@")||t.url?.startsWith("/node_modules"))return i();const o=(await u.ssrLoadModule(r)).default;if(!o)return console.error(`Failed to find a named export "default" from ${r}`),i();f(async d=>{const e=await o.fetch(d,await c.getBindings());if(n?.injectClientScript!==!1&&!e.headers.get("transfer-encoding")?.match("chunked")&&e.headers.get("content-type")?.match(/^text\/html/)){const m=await e.text()+'<script type="module" src="/@vite/client"></script>',a=new Headers(e.headers);return a.delete("content-length"),new Response(m,{status:e.status,headers:a})}return e})(t,l)}}s.middlewares.use(await p(s))}}]}export{x as devServer};
import { devServer } from './dev-server.js';
export { DevServerOptions } from './dev-server.js';
import 'miniflare';
import 'vite';

@@ -4,0 +5,0 @@

{
"name": "@hono/vite-dev-server",
"description": "Vite dev-server plugin for Hono",
"version": "0.0.1",
"version": "0.0.2",
"types": "dist/index.d.ts",

@@ -50,3 +50,4 @@ "module": "dist/index.js",

"dependencies": {
"@hono/node-server": "^1.1.1"
"@hono/node-server": "^1.1.1",
"miniflare": "^3.20230904.0"
},

@@ -53,0 +54,0 @@ "scripts": {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc