This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script setup lang="ts"> | |
import { CustomButton } from 'component.library'; | |
defineProps<{ msg: string }>() | |
const count = ref(0) | |
</script> | |
<CustomButton text="Custom Button Text" /> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { CustomButton } from 'component.library'; | |
export default defineComponent({ | |
components: { | |
CustomButton | |
}, | |
<CustomButton text="Click me" /> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "component.library", | |
"private": true, | |
"version": "0.0.0", | |
"description": "A component library", | |
"type": "module", | |
"main": "./dist/FileNameInDist.umd.cjs", | |
"module": "./dist/FileNameInDist.js", | |
"types": "./dist/index.d.ts", | |
"exports": { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
change Dependencies to peerDependencies "peerDependencies": { | |
"vue": "^3.5.13" | |
}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"main": "./dist/FileNameInDist.umd.js", | |
"module": "./dist/FileNameInDist.js", | |
"types": "./dist/index.d.ts", | |
"exports": { | |
".": { | |
"import": "./dist/FileNameInDist.js", | |
"require": "./dist/FileNameInDist.umd.js" | |
} | |
}, | |
"files": [ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"type": "module", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { defineConfig } from "vite"; | |
import vue from "@vitejs/plugin-vue"; | |
import { resolve } from "node:path"; | |
import dts from "vite-plugin-dts"; | |
// https://vitejs.dev/config/ | |
export default defineConfig({ | |
plugins: [vue(), dts({ tsconfigPath: './tsconfig.app.json' })], | |
build: { | |
lib: { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import CustomButton from "./components/CustomButton.vue"; | |
export { CustomButton }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<button class="custom-button"> | |
{{ props.text }} | |
</button> | |
</template> | |
<script setup lang="ts"> | |
const props = defineProps<{ | |
text: string; | |
}>(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var builder = WebApplication.CreateBuilder(args); | |
// Add services to the container. | |
builder.Services.AddControllers(); | |
// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle | |
builder.Services.AddEndpointsApiExplorer(); | |
builder.Services.AddSwaggerGen(); | |
// Configure CORS |