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

vite-plugin-style-to-vw

Package Overview
Dependencies
Maintainers
0
Versions
38
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vite-plugin-style-to-vw - npm Package Compare versions

Comparing version 1.8.1 to 1.8.2

2

dist/index.d.ts
import { Plugin } from 'vite';
interface IdefaultsProp {
allReplace:boolean,
allReplace?:boolean,
unitToConvert?: string,

@@ -6,0 +6,0 @@ viewportWidth?: number,

{
"name": "vite-plugin-style-to-vw",
"version": "1.8.1",
"version": "1.8.2",
"description": "一个可以将签内样式px转换vw的plugin",

@@ -5,0 +5,0 @@ "exports": {

import { Plugin } from "vite";
export interface IdefaultsProp {
allReplace:boolean,
allReplace?:boolean,
unitToConvert?: string,

@@ -5,0 +5,0 @@ viewportWidth?: number,

@@ -48,3 +48,6 @@ import type { IdefaultsProp } from './index.d'

function vitePluginStyleToVw(customOptions: IdefaultsProp = defaultsProp) {
customOptions = Object.assign(defaultsProp, customOptions)
// 合并
const copyDefaultsProp = Object.assign({}, defaultsProp)
// 生成自定义
customOptions = Object.assign(copyDefaultsProp, customOptions)
try {

@@ -186,2 +189,3 @@ // 异步写入文件

try {
// 读取文件,node端生成合并的配置,
const json = await import('./file.json')

@@ -196,3 +200,4 @@ extraOptions = json.default

export const stylePxToVw = (code: string | number, customOptions: IdefaultsProp = {}) => {
customOptions = Object.assign(extraOptions, customOptions)
const copyExtraOptions = Object.assign({}, extraOptions)
customOptions = Object.assign(copyExtraOptions, customOptions)
if (typeof code === 'number' || (typeof Number(code) === 'number' && !isNaN(Number(code

@@ -199,0 +204,0 @@ )))) {

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