vite-plugin-dynamic-import
Advanced tools
Comparing version 0.3.1 to 0.3.2
@@ -22,8 +22,7 @@ "use strict"; | ||
}) | ||
} | ||
} | ||
`; | ||
} | ||
} | ||
`; | ||
return { name, body }; | ||
} | ||
exports.generateDynamicImportRuntime = generateDynamicImportRuntime; |
@@ -52,3 +52,3 @@ "use strict"; | ||
const allImportee = listAllImportee(globExtensions, files, startsWithAliasFiles); | ||
const importRuntime = (0, dynamic_import_helper_1.generateDynamicImportRuntime)(allImportee, dynamicImportIndex); | ||
const importRuntime = (0, dynamic_import_helper_1.generateDynamicImportRuntime)(allImportee, dynamicImportIndex++); | ||
dynamicImportRecord.push({ | ||
@@ -71,3 +71,3 @@ node: { | ||
} | ||
const dyImptFnBody = dynamicImportRecord.map(e => e.importRuntime.body).join('\n'); | ||
const dyImptFnBody = dynamicImportRecord.map(e => e.importRuntime.body).join(''); | ||
// TODO: sourcemap | ||
@@ -94,3 +94,3 @@ return code + ` | ||
glob = (0, utils_1.fixGlob)(glob) || glob; | ||
// fill necessary ext | ||
// if not extension is not specified, fill necessary extensions | ||
// e.g. `../views/*` -> `../views/*{.js,.ts,.vue ...}` | ||
@@ -97,0 +97,0 @@ if (!extensions.includes(path_1.default.extname(glob))) { |
{ | ||
"name": "vite-plugin-dynamic-import", | ||
"version": "0.3.1", | ||
"version": "0.3.2", | ||
"description": "Enhance Vite builtin dynamic import", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -124,1 +124,5 @@ # vite-plugin-dynamic-import [![NPM version](https://img.shields.io/npm/v/vite-plugin-dynamic-import.svg)](https://npmjs.org/package/vite-plugin-dynamic-import) [![awesome-vite](https://awesome.re/badge.svg)](https://github.com/vitejs/awesome-vite) | ||
``` | ||
## TODO | ||
- [ ] support `alias.customResolver` |
@@ -27,8 +27,7 @@ export interface DynamicImportRuntime { | ||
}) | ||
} | ||
} | ||
` | ||
} | ||
} | ||
` | ||
return { name, body } | ||
} |
@@ -72,3 +72,3 @@ import path from 'path' | ||
) | ||
const importRuntime = generateDynamicImportRuntime(allImportee, dynamicImportIndex) | ||
const importRuntime = generateDynamicImportRuntime(allImportee, dynamicImportIndex++) | ||
@@ -93,3 +93,3 @@ dynamicImportRecord.push({ | ||
} | ||
const dyImptFnBody = dynamicImportRecord.map(e => e.importRuntime.body).join('\n') | ||
const dyImptFnBody = dynamicImportRecord.map(e => e.importRuntime.body).join('') | ||
@@ -132,3 +132,3 @@ // TODO: sourcemap | ||
// fill necessary ext | ||
// if not extension is not specified, fill necessary extensions | ||
// e.g. `../views/*` -> `../views/*{.js,.ts,.vue ...}` | ||
@@ -135,0 +135,0 @@ if (!extensions.includes(path.extname(glob))) { |
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
40885
128