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

vite-plugin-node

Package Overview
Dependencies
Maintainers
1
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vite-plugin-node - npm Package Compare versions

Comparing version 2.0.0 to 3.0.0

4

dist/server/index.d.ts

@@ -15,3 +15,3 @@ /// <reference types="express" />

};
export declare const getPluginConfig: (server: ViteDevServer) => VitePluginNodeConfig;
export declare const createMiddleware: (server: ViteDevServer) => Connect.HandleFunction;
export declare const getPluginConfig: (server: ViteDevServer) => Promise<VitePluginNodeConfig>;
export declare const createMiddleware: (server: ViteDevServer) => Promise<Connect.HandleFunction>;

@@ -24,10 +24,12 @@ "use strict";

};
const getPluginConfig = (server) => {
const env = { command: 'serve', mode: '' };
const getPluginConfig = async (server) => {
const plugin = server.config.plugins.find(p => p.name === __1.PLUGIN_NAME);
if (!plugin) {
console.error('Please setup VitePluginNode in your vite.config.js first');
(0, process_1.exit)(1);
}
return plugin.config({}, { command: 'serve', mode: '' })
.VitePluginNodeConfig;
let userConfig;
if (typeof plugin.config === 'function')
userConfig = await plugin.config({}, env);
if (userConfig)
return userConfig.VitePluginNodeConfig;
console.error('Please setup VitePluginNode in your vite.config.js first');
(0, process_1.exit)(1);
};

@@ -43,4 +45,4 @@ exports.getPluginConfig = getPluginConfig;

};
const createMiddleware = (server) => {
const config = (0, exports.getPluginConfig)(server);
const createMiddleware = async (server) => {
const config = await (0, exports.getPluginConfig)(server);
const logger = server.config.logger;

@@ -47,0 +49,0 @@ const requestHandler = getRequestHandler(config.adapter);

@@ -64,4 +64,4 @@ "use strict";

},
configureServer: (server) => {
server.middlewares.use((0, server_1.createMiddleware)(server));
configureServer: async (server) => {
server.middlewares.use(await (0, server_1.createMiddleware)(server));
},

@@ -68,0 +68,0 @@ },

{
"name": "vite-plugin-node",
"version": "2.0.0",
"version": "3.0.0",
"description": "Vite plugin to enable your node server HMR",

@@ -31,3 +31,4 @@ "author": "Axe",

"peerDependencies": {
"vite": "^3.0.0"
"@swc/core": "^1.2.153",
"vite": "^4.0.0"
},

@@ -57,3 +58,3 @@ "peerDependenciesMeta": {

"rxjs": "^7.5.5",
"vite": "^2.9.8"
"vite": "^4.0.0"
},

@@ -60,0 +61,0 @@ "scripts": {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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