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 0.0.6 to 0.0.7

dist/rollup-plugin-swc.d.ts

1

dist/index.d.ts
/// <reference types="node" />
import * as http from 'http';
import { UserConfig, ViteDevServer } from "vite";
export { RollupPluginSwc } from "./rollup-plugin-swc";
export { VitePluginNode } from "./vite-plugin-node";

@@ -5,0 +6,0 @@ export declare interface IServer<APP = {}, SERVER = http.Server> {

4

dist/index.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.PLUGIN_NAME = exports.WS_PORT = exports.VitePluginNode = void 0;
exports.PLUGIN_NAME = exports.WS_PORT = exports.VitePluginNode = exports.RollupPluginSwc = void 0;
var rollup_plugin_swc_1 = require("./rollup-plugin-swc");
Object.defineProperty(exports, "RollupPluginSwc", { enumerable: true, get: function () { return rollup_plugin_swc_1.RollupPluginSwc; } });
var vite_plugin_node_1 = require("./vite-plugin-node");

@@ -5,0 +7,0 @@ Object.defineProperty(exports, "VitePluginNode", { enumerable: true, get: function () { return vite_plugin_node_1.VitePluginNode; } });

export declare function createDebugger(ns: string): (msg: string, ...args: any[]) => void;
export declare const queryRE: RegExp;
export declare const hashRE: RegExp;
export declare const cleanUrl: (url: string) => string;

@@ -6,3 +6,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.createDebugger = void 0;
exports.cleanUrl = exports.hashRE = exports.queryRE = exports.createDebugger = void 0;
/**

@@ -19,2 +19,6 @@ * modified from vitejs source code, just to make the console output looks vite-like

exports.createDebugger = createDebugger;
exports.queryRE = /\?.*$/;
exports.hashRE = /#.*$/;
const cleanUrl = (url) => url.replace(exports.hashRE, '').replace(exports.queryRE, '');
exports.cleanUrl = cleanUrl;
//# sourceMappingURL=utils.js.map
import { Plugin } from 'vite';
import { VitePluginNodeConfig } from '.';
export declare function VitePluginNode(cfg: VitePluginNodeConfig): Plugin;
export declare function VitePluginNode(cfg: VitePluginNodeConfig): Plugin[];
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.VitePluginNode = void 0;
const rollup_plugin_swc_1 = __importDefault(require("rollup-plugin-swc"));
const _1 = require(".");
const rollup_plugin_swc_1 = require("./rollup-plugin-swc");
function VitePluginNode(cfg) {

@@ -14,8 +11,22 @@ const config = {

};
const plugins = [];
const plugins = [
{
name: _1.PLUGIN_NAME,
config: () => ({
server: {
middlewareMode: true,
hmr: {
port: _1.WS_PORT
}
},
esbuild: config.tsCompiler === 'esbuild' ? {} : false,
VitePluginNodeConfig: config,
}),
apply: 'serve'
}
];
if (config.tsCompiler === 'swc') {
plugins.push({
...rollup_plugin_swc_1.default({
...rollup_plugin_swc_1.RollupPluginSwc({
jsc: {
loose: true,
target: 'es2019',

@@ -31,22 +42,8 @@ parser: {

},
}),
enforce: 'pre',
apply: 'serve'
})
});
}
return {
name: _1.PLUGIN_NAME,
config: () => ({
server: {
middlewareMode: true,
hmr: {
port: _1.WS_PORT
}
},
plugins,
VitePluginNodeConfig: config
}),
};
return plugins;
}
exports.VitePluginNode = VitePluginNode;
//# sourceMappingURL=vite-plugin-node.js.map
{
"name": "vite-plugin-node",
"version": "0.0.6",
"version": "0.0.7",
"description": "Vite plugin to enable your node server HMR",

@@ -14,6 +14,7 @@ "main": "dist/index.js",

"dependencies": {
"@swc/core": "^1.2.47",
"@rollup/pluginutils": "^4.1.0",
"@swc/core": "^1.2.49",
"@types/estree": "^0.0.46",
"chalk": "^4.1.0",
"debug": "^4.3.1",
"rollup-plugin-swc": "^0.1.4",
"vite": "^2.0.1",

@@ -20,0 +21,0 @@ "websocket": "^1.0.33"

@@ -24,3 +24,3 @@ # Vite Plugin Node

plugins: [
VitePluginNode({
...VitePluginNode({
// the node framework yout are using,

@@ -27,0 +27,0 @@ // currently this plugin support 'express', 'nest' and 'custom',

Sorry, the diff of this file is not supported yet

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