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

vite-plugin-dynamic-import

Package Overview
Dependencies
Maintainers
1
Versions
52
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vite-plugin-dynamic-import - npm Package Compare versions

Comparing version 0.3.2 to 0.3.3

2

dist/alias.js

@@ -35,3 +35,3 @@ "use strict";

if (path_1.default.isAbsolute(replacement)) {
const relative = path_1.default.relative(/* 🚧 */ path_1.default.dirname(id), replacement);
const relative = path_1.default.posix.relative(/* 🚧 */ path_1.default.dirname(id), replacement);
const relativeUrl = relative === ''

@@ -38,0 +38,0 @@ ? `./${url.replace(_find, '').replace(/^\//, '')}`

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.generateDynamicImportRuntime = void 0;
function generateDynamicImportRuntime(entries, dynamicImportIndex) {
const _entries = Object.entries(entries);
function generateDynamicImportRuntime(
// localFilename: Array<possible importee>
entries, dynamicImportIndex) {
const name = `__variableDynamicImportRuntime${dynamicImportIndex}__`;
const cases = _entries.map(([localFile, importeeList]) => {
const cases = Object.entries(entries).map(([localFile, importeeList]) => {
const c = importeeList.map(importee => ` case '${importee}':`);

@@ -9,0 +10,0 @@ return `${c.join('\n')}

{
"name": "vite-plugin-dynamic-import",
"version": "0.3.2",
"version": "0.3.3",
"description": "Enhance Vite builtin dynamic import",

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

@@ -45,3 +45,3 @@ import path from 'path'

if (path.isAbsolute(replacement)) {
const relative = path.relative(/* 🚧 */path.dirname(id), replacement)
const relative = path.posix.relative(/* 🚧 */path.dirname(id), replacement)
const relativeUrl = relative === ''

@@ -48,0 +48,0 @@ ? `./${url.replace(_find, '').replace(/^\//, '')}`

@@ -7,8 +7,8 @@ export interface DynamicImportRuntime {

export function generateDynamicImportRuntime(
// localFilename: Array<possible importee>
entries: Record<string, string[]>,
dynamicImportIndex: number | string,
): DynamicImportRuntime {
const _entries = Object.entries(entries)
const name = `__variableDynamicImportRuntime${dynamicImportIndex}__`
const cases = _entries.map(([localFile, importeeList]) => {
const cases = Object.entries(entries).map(([localFile, importeeList]) => {
const c = importeeList.map(importee => ` case '${importee}':`)

@@ -15,0 +15,0 @@ return `${c.join('\n')}

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