FranckFreiburger / vue3-sfc-loader

Single File Component loader for Vue2 and Vue3. Load .vue files directly from your HTML. No node.js environment, no build step.
MIT License
1.03k stars 116 forks source link

vue3-sfc-loader.esm.js should expose the vue is has embedded #177

Closed lfmunoz closed 5 months ago

lfmunoz commented 5 months ago

My code looks like this:

import * as Vue from '../js_ext/vue.js'
console.log(`vue.js version ${Vue.version}`)    <-----  3.3.4

import { loadModule, vueVersion } from '../js_ext/vue3-sfc-loader.esm.js'
console.log(`vu3-sfc-loader vue version ${vueVersion} `)   <-----  3.4.5 

The issue is I have to import Vue twice.

vue3-sfc-loader.esm.js has it's own internal Vue so it needs to expose that. the solution should allow for the following:

import { loadModule, vueVersion, Vue } from '../js_ext/vue3-sfc-loader.esm.js'
console.log(`vue.js version ${Vue.version}`)    <-----  3.4.5
lfmunoz commented 5 months ago

I'm probably mistaken about this seem like only @vue/compiler-sfc is included in vue3-sfc-loader.esm.js and doesn't include the runtime. Please go ahead and close if that is the case.

FranckFreiburger commented 5 months ago

lfmunoz, you are true, vue3-sfc-loader only embeds the vue compiler, and expose its version in vueVersion