From 1f3c246709ab27194c94148d8c20d87098acf455 Mon Sep 17 00:00:00 2001 From: baozouai Date: Tue, 23 Apr 2024 20:00:23 +0800 Subject: [PATCH] feat: support importAssertions --- playgrounds/vue/src/main.ts | 2 ++ src/index.ts | 1 + 2 files changed, 3 insertions(+) diff --git a/playgrounds/vue/src/main.ts b/playgrounds/vue/src/main.ts index d35e28a..b8935ed 100644 --- a/playgrounds/vue/src/main.ts +++ b/playgrounds/vue/src/main.ts @@ -1,7 +1,9 @@ import { createApp } from 'vue' +import packageJson from '../package.json' assert { type: 'json' } import App from './App.vue' import './index.css' +console.log(packageJson) const app = createApp(App) app.mount('#app') diff --git a/src/index.ts b/src/index.ts index bdf2b55..ff12a54 100644 --- a/src/index.ts +++ b/src/index.ts @@ -139,6 +139,7 @@ export default function enhanceLogPlugin(options: Options = {}): PluginOption { const ast = parse(code, { sourceType: 'unambiguous', sourceFilename: id, + plugins: ['importAssertions'], }) const consumer = await new SourceMapConsumer(rawSourcemap as RawSourceMap)