vite-plugin-progress
Advanced tools
Comparing version 0.0.6 to 0.0.7
@@ -51,5 +51,6 @@ var __create = Object.create; | ||
var filePath = import_path.default.join(dirPath, "index.json"); | ||
var isExists = import_fs.default.existsSync(filePath) || false; | ||
var isFileExists = import_fs.default.existsSync(filePath) || false; | ||
var isDirExists = import_fs.default.existsSync(dirPath) || false; | ||
var getCacheData = () => { | ||
if (!isExists) | ||
if (!isFileExists) | ||
return { | ||
@@ -62,3 +63,3 @@ cacheTransformCount: 0, | ||
var setCacheData = (data) => { | ||
!isExists && import_fs.default.mkdirSync(dirPath); | ||
!isDirExists && import_fs.default.mkdirSync(dirPath); | ||
import_fs.default.writeFileSync(filePath, JSON.stringify(data)); | ||
@@ -95,4 +96,4 @@ }; | ||
options.total = (options == null ? void 0 : options.total) || 100; | ||
const transforming = isExists ? `${import_picocolors.default.magenta("Transforms:")} :transformCur/:transformTotal | ` : ""; | ||
const chunks = isExists ? `${import_picocolors.default.magenta("Chunks:")} :chunkCur/:chunkTotal | ` : ""; | ||
const transforming = isFileExists ? `${import_picocolors.default.magenta("Transforms:")} :transformCur/:transformTotal | ` : ""; | ||
const chunks = isFileExists ? `${import_picocolors.default.magenta("Chunks:")} :chunkCur/:chunkTotal | ` : ""; | ||
const barText = `${import_picocolors.default.cyan(`[:bar]`)}`; | ||
@@ -102,3 +103,3 @@ const barFormat = options.format || `${import_picocolors.default.green("Building")} ${barText} :percent | ${transforming}${chunks}Time: :elapseds`; | ||
bar = new import_progress.default(barFormat, options); | ||
if (!isExists) { | ||
if (!isFileExists) { | ||
const readDir = import_rd.default.readSync(options.srcDir || "src"); | ||
@@ -112,3 +113,3 @@ const reg = /\.(vue|ts|js|jsx|tsx|css|scss||sass|styl|less)$/gi; | ||
transformCount++; | ||
if (!isExists) { | ||
if (!isFileExists) { | ||
const reg = /node_modules/gi; | ||
@@ -124,3 +125,3 @@ if (!reg.test(id) && percent < 0.25) { | ||
} | ||
if (isExists) | ||
if (isFileExists) | ||
runCachedData(); | ||
@@ -141,3 +142,3 @@ bar.update(lastPercent, { | ||
if (lastPercent <= 0.95) | ||
isExists ? runCachedData() : lastPercent = +(lastPercent + 5e-3).toFixed(4); | ||
isFileExists ? runCachedData() : lastPercent = +(lastPercent + 5e-3).toFixed(4); | ||
bar.update(lastPercent, { | ||
@@ -144,0 +145,0 @@ transformTotal: cacheTransformCount, |
{ | ||
"name": "vite-plugin-progress", | ||
"version": "0.0.6", | ||
"version": "0.0.7", | ||
"description": "A progress bar plugin for Vite.", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
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
21744
390