@leaflink/vite-plugin-importmap
Advanced tools
Comparing version 1.0.2 to 1.0.3
@@ -6,3 +6,3 @@ import { type Plugin } from 'vite'; | ||
}; | ||
export default function buildImportMap(config: ImportMap): Plugin; | ||
export default function buildImportMap(importMap: ImportMap): Plugin; | ||
export {}; |
@@ -1,11 +0,2 @@ | ||
const prefix = '/@import-maps/'; | ||
export default function buildImportMap(config) { | ||
const importKeys = Object.keys(config.imports); | ||
const importMap = { | ||
imports: importKeys.reduce((memo, importName) => { | ||
memo[prefix + importName] = config.imports[importName]; | ||
return memo; | ||
}, {}), | ||
scopes: config.scopes, | ||
}; | ||
export default function buildImportMap(importMap) { | ||
return { | ||
@@ -15,11 +6,5 @@ name: 'plugin-importmap', | ||
return { | ||
resolve: { | ||
alias: importKeys.reduce((memo, importName) => { | ||
memo[importName] = prefix + importName; | ||
return memo; | ||
}, {}), | ||
}, | ||
build: { | ||
rollupOptions: { | ||
external: importKeys.map((importName) => prefix + importName), | ||
external: Object.keys(importMap.imports), | ||
}, | ||
@@ -26,0 +11,0 @@ }, |
{ | ||
"name": "@leaflink/vite-plugin-importmap", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"description": "Vite plugin to allow loading dependencies via native import maps", | ||
@@ -5,0 +5,0 @@ "exports": { |
# @leaflink/vite-plugin-importmap | ||
Vite plugin to allow loading dependencies via native import maps, based on [vite-plugin-import-maps](https://github.com/pakholeung37/vite-plugin-import-maps). | ||
Vite plugin to allow loading dependencies via native import maps, based on [vite-plugin-import-maps](https://github.com/pakholeung37/vite-plugin-import-maps). It does not re-alias modules on build so can support peer dependencies loaded via import maps. | ||
@@ -5,0 +5,0 @@ ## Installation |
Sorry, the diff of this file is not supported yet
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
4179
39