Skip to content

how could someone make library code available without using a cdn #151

@joaomelo

Description

@joaomelo

Hi there,

Excellent framework and REPL library. I'm an enthusiastic user of Vue. I'm authoring a library of vue components to be used in many projects in my company. I'm using the "@vue/repl" to create a documentation page where de lib components are loaded and presented with live examples. Below is a draft of such a page.

Captura de tela 2023-08-21 134817

I also intend to use this playground to do incremental development of the components watching the behavior on the documentation page as I enhance the actual lib component. In that use case, I don't want to use the imports map to point to library code in a repository while developing locally. That's because the publish code is not the one I want to import the components. I want to import the component's local version. But I don't know how to do that.

I created a WPlaygroung component and imaged I could create some global scope for every REPL with the lib code

<script setup>
import { Repl } from "@vue/repl";
import CodeMirror from "@vue/repl/codemirror-editor";
import "@vue/repl/style.css";
defineProps({
   exampleCode: {
     type: String,
     default: null,
   },
});
</script>
<template>
  <Repl :editor="CodeMirror" />
</template>

Can you help me figure out a way to inject the library components and functions in the REPL scope without using a CDN but referencing the local code I'm working on?

Thanks a lot,
JM

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions