vite-plugin-node
Advanced tools
Comparing version 0.0.6 to 0.0.7
/// <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> { |
"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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
32085
28
409
7
+ Added@rollup/pluginutils@^4.1.0
+ Added@types/estree@^0.0.46
+ Added@rollup/pluginutils@4.2.1(transitive)
+ Added@types/estree@0.0.46(transitive)
+ Addedestree-walker@2.0.2(transitive)
+ Addedpicomatch@2.3.1(transitive)
- Removedrollup-plugin-swc@^0.1.4
- Removed@rollup/rollup-android-arm-eabi@4.28.1(transitive)
- Removed@rollup/rollup-android-arm64@4.28.1(transitive)
- Removed@rollup/rollup-darwin-arm64@4.28.1(transitive)
- Removed@rollup/rollup-darwin-x64@4.28.1(transitive)
- Removed@rollup/rollup-freebsd-arm64@4.28.1(transitive)
- Removed@rollup/rollup-freebsd-x64@4.28.1(transitive)
- Removed@rollup/rollup-linux-arm-gnueabihf@4.28.1(transitive)
- Removed@rollup/rollup-linux-arm-musleabihf@4.28.1(transitive)
- Removed@rollup/rollup-linux-arm64-gnu@4.28.1(transitive)
- Removed@rollup/rollup-linux-arm64-musl@4.28.1(transitive)
- Removed@rollup/rollup-linux-loongarch64-gnu@4.28.1(transitive)
- Removed@rollup/rollup-linux-powerpc64le-gnu@4.28.1(transitive)
- Removed@rollup/rollup-linux-riscv64-gnu@4.28.1(transitive)
- Removed@rollup/rollup-linux-s390x-gnu@4.28.1(transitive)
- Removed@rollup/rollup-linux-x64-gnu@4.28.1(transitive)
- Removed@rollup/rollup-linux-x64-musl@4.28.1(transitive)
- Removed@rollup/rollup-win32-arm64-msvc@4.28.1(transitive)
- Removed@rollup/rollup-win32-ia32-msvc@4.28.1(transitive)
- Removed@rollup/rollup-win32-x64-msvc@4.28.1(transitive)
- Removed@types/estree@1.0.6(transitive)
- Removedrollup@4.28.1(transitive)
- Removedrollup-plugin-swc@0.1.4(transitive)
Updated@swc/core@^1.2.49