@leaflink/vite-plugin-importmap
Advanced tools
Comparing version 0.0.0-PR-4--1ae70ff to 0.0.0-PR-4--9719554
@@ -6,3 +6,3 @@ import { type Plugin } from 'vite'; | ||
}; | ||
export declare function buildImportMap(config: ImportMap): Plugin; | ||
export default function buildImportMap(config: ImportMap): Plugin; | ||
export {}; |
const prefix = '/@import-maps/'; | ||
export function buildImportMap(config) { | ||
export default function buildImportMap(config) { | ||
const importKeys = Object.keys(config.imports); | ||
@@ -4,0 +4,0 @@ const importMap = { |
import { expect, it } from 'vitest'; | ||
import { buildImportMap } from './index.js'; | ||
import buildImportMap from './index.js'; | ||
it('resolves configured imports to the import map aliases', () => { | ||
@@ -4,0 +4,0 @@ const pluginResult = buildImportMap({ |
{ | ||
"name": "@leaflink/vite-plugin-importmap", | ||
"version": "0.0.0-PR-4--1ae70ff", | ||
"version": "0.0.0-PR-4--9719554", | ||
"description": "Vite plugin to allow loading dependencies via native import maps", | ||
@@ -5,0 +5,0 @@ "exports": { |
@@ -11,6 +11,6 @@ # @leaflink/vite-plugin-importmap | ||
Import the `buildImportMap` function and add to the plugins section of your Vite config. | ||
Import and add to the plugins section of your Vite config: | ||
``` | ||
import { buildImportMap } from '@leaflink/vite-plugin-importmap'; | ||
import buildImportMap from '@leaflink/vite-plugin-importmap'; | ||
@@ -17,0 +17,0 @@ export default defineConfig(({ mode }) => { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
6817