vite-plugin-dynamic-import
Advanced tools
Comparing version 0.3.2 to 0.3.3
@@ -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')} |
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
40927
933