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

vite-plugin-live-reload

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vite-plugin-live-reload - npm Package Compare versions

Comparing version 2.1.0 to 3.0.0

dist/index.cjs

2

dist/index.d.ts

@@ -22,2 +22,2 @@ import { Plugin } from 'vite';

export default _default;
export { _default as default };

@@ -1,34 +0,23 @@

'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
var chokidar = require('chokidar');
var chalk = require('chalk');
var path = require('path');
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
var chokidar__default = /*#__PURE__*/_interopDefaultLegacy(chokidar);
var chalk__default = /*#__PURE__*/_interopDefaultLegacy(chalk);
var path__default = /*#__PURE__*/_interopDefaultLegacy(path);
// src/index.ts
import chokidar from "chokidar";
import colors from "picocolors";
import path from "path";
function getShortName(file, root) {
return file.startsWith(root + "/") ? path__default['default'].posix.relative(root, file) : file;
return file.startsWith(root + "/") ? path.posix.relative(root, file) : file;
}
var index = (paths, config = {}) => ({
var src_default = (paths, config = {}) => ({
name: "vite-plugin-live-reload",
configureServer({ws, config: {root: viteRoot, logger}}) {
configureServer({ ws, config: { root: viteRoot, logger } }) {
const root = config.root || viteRoot;
const reload = (path2) => {
var _a;
ws.send({type: "full-reload", path: config.alwaysReload ? "*" : path2});
if ((_a = config.log) != null ? _a : true) {
logger.info(chalk__default['default'].green(`page reload `) + chalk__default['default'].dim(getShortName(path2, root)), {clear: true, timestamp: true});
ws.send({ type: "full-reload", path: config.alwaysReload ? "*" : path2 });
if (config.log ?? true) {
logger.info(colors.green(`page reload `) + colors.dim(getShortName(path2, root)), { clear: true, timestamp: true });
}
};
chokidar__default['default'].watch(paths, {cwd: root, ignoreInitial: true, ...config}).on("add", reload).on("change", reload);
chokidar.watch(paths, { cwd: root, ignoreInitial: true, ...config }).on("add", reload).on("change", reload);
}
});
exports.default = index;
//# sourceMappingURL=index.js.map
export {
src_default as default
};
{
"name": "vite-plugin-live-reload",
"version": "2.1.0",
"description": "A *very* simple live reloading plugin for vite.",
"main": "dist/index.js",
"version": "3.0.0",
"description": "A simple live reloading plugin for vite.",
"type": "module",
"main": "dist/index.cjs",
"module": "dist/index.js",
"exports": {
".": {
"import": "./dist/index.js",
"require": "./dist/index.cjs"
}
},
"types": "dist/index.d.ts",
"scripts": {
"dev": "rollup -c --watch",
"build": "rollup -c"
"build": "tsup src/index.ts --format esm,cjs --clean --dts"
},

@@ -27,14 +34,10 @@ "repository": {

"devDependencies": {
"@types/node": "^14.14.20",
"esbuild": "^0.8.31",
"rollup": "^2.36.1",
"rollup-plugin-dts": "^2.0.1",
"rollup-plugin-esbuild": "^2.6.1",
"typescript": "^4.1.3",
"vite": "^2.0.0-beta.27"
"@types/node": "^18.0.6",
"tsup": "^6.1.3",
"vite": "^3.0.1"
},
"dependencies": {
"chalk": "^4.1.0",
"chokidar": "^3.5.0"
"chokidar": "^3.5.0",
"picocolors": "^1.0.0"
}
}
# vite-plugin-live-reload
A *very* simple live reloading plugin for [vite](https://github.com/vitejs/vite).
A simple live reloading plugin for [vite](https://github.com/vitejs/vite).

@@ -4,0 +4,0 @@ ## Example

import { Plugin, ViteDevServer } from 'vite'
import chokidar, { WatchOptions } from 'chokidar'
import chalk from 'chalk'
import colors from 'picocolors'
import path from 'path'

@@ -49,3 +49,3 @@

logger.info(
chalk.green(`page reload `) + chalk.dim(getShortName(path, root)),
colors.green(`page reload `) + colors.dim(getShortName(path, root)),
{ clear: true, timestamp: true }

@@ -52,0 +52,0 @@ )

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