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

vite-plugin-auto-zip

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-auto-zip - npm Package Compare versions

Comparing version 1.1.0 to 1.1.1

31

dist/vite-plugin-auto-zip.js
import * as path from 'node:path';
import {resolve} from 'node:path';
import { resolve } from 'node:path';
import JSZip from 'jszip';

@@ -7,3 +7,3 @@ import * as fs from 'node:fs';

function makeZip(config) {
const {outPath: distPath, outName: fileName} = config;
const { outPath: distPath, outName: fileName } = config;
const zip = new JSZip();

@@ -14,13 +14,14 @@ const readDir = function (zipInstance, dirPath) {

.forEach(fileName => {
const fillPath = path.join(dirPath, "./", fileName);
const file = fs.statSync(fillPath);
// 如果是文件夹的话需要递归遍历下面的子文件
if (file.isDirectory()) {
const dirZip = zipInstance.folder(fileName);
readDir(dirZip, fillPath);
} else {
// 读取每个文件为buffer存到zip中
zip.file(fileName, fs.readFileSync(fillPath));
}
});
const fillPath = path.join(dirPath, "./", fileName);
const file = fs.statSync(fillPath);
// 如果是文件夹的话需要递归遍历下面的子文件
if (file.isDirectory()) {
const dirZip = zipInstance.folder(fileName);
readDir(dirZip, fillPath);
}
else {
// 读取每个文件为buffer存到zip中
zip.file(fileName, fs.readFileSync(fillPath));
}
});
};

@@ -53,3 +54,3 @@ const removeExistedZip = () => {

function AutoZip(folderPath, outPath = './dist', outName = 'dist.zip') {
const options = {folderPath, outPath, outName};
const options = { folderPath, outPath, outName };
return {

@@ -83,2 +84,2 @@ name: 'vite-plugin-auto-zip',

export {AutoZip as default, zip};
export { AutoZip as default, zip };
{
"name": "vite-plugin-auto-zip",
"version": "1.1.0",
"version": "1.1.1",
"description": "provide a vite plugin then zip your file after compile done",

@@ -16,2 +16,3 @@ "main": "dist/vite-plugin-auto-zip.umd.js",

"build:types": "rimraf -rf ./types && mkdir ./types && tsc -p ./tsconfig.json",
"publish:npm": "yarn run build && npm publish",
"test": "node test.js"

@@ -18,0 +19,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