Socket
Socket
Sign inDemoInstall

@achmadk/vite-plugin-svgr

Package Overview
Dependencies
252
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.1.0 to 1.1.1

9

dist/index.d.ts

@@ -21,13 +21,4 @@ import type { Config } from '@svgr/core';

sourceMap?: boolean;
/**
* @default undefined
*/
svgrOptions?: Config;
/**
* @default undefined
*/
esbuildOptions?: EsbuildTransformOptions;
/**
* @default undefined
*/
exclude?: FilterPattern;

@@ -34,0 +25,0 @@ /**

12

dist/index.js
'use strict';
const pluginutils = require('@rollup/pluginutils');
const core = require('@svgr/core');
const fs = require('fs');

@@ -10,6 +11,6 @@ const vite = require('vite');

sourceMap = false,
svgrOptions = void 0,
esbuildOptions = void 0,
svgrOptions,
esbuildOptions,
include = "**/*.svg",
exclude = void 0,
exclude,
isTypescript = false

@@ -22,3 +23,2 @@ }) {

if (filter(id)) {
const { transform } = await import('@svgr/core');
const svgCode = await fs.promises.readFile(

@@ -28,3 +28,3 @@ id.replace(/\?.*$/, ""),

);
const componentCode = await transform(svgCode, svgrOptions, {
const componentCode = core.transform.sync(svgCode, svgrOptions, {
filePath: id,

@@ -35,3 +35,3 @@ caller: {

});
const res = await vite.transformWithEsbuild(componentCode, id, {
const res = await vite.transformWithEsbuild(`export default ${componentCode}`, id, {
loader: isTypescript ? "tsx" : "jsx",

@@ -38,0 +38,0 @@ ...esbuildOptions ?? {}

{
"name": "@achmadk/vite-plugin-svgr",
"private": false,
"version": "1.1.0",
"version": "1.1.1",
"description": "Vite plugin to transform SVGs into React components",

@@ -6,0 +6,0 @@ "main": "./dist/index.js",

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc