Skip to content

Commit

Permalink
chore: add lib build config
Browse files Browse the repository at this point in the history
  • Loading branch information
iamandrewluca committed Oct 31, 2024
1 parent fd7f50c commit c216439
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 1 deletion.
18 changes: 18 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 13 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,19 @@
{
"name": "vue-local-scope",
"name": "@allindevelopers/vue-local-scope",
"private": true,
"version": "0.0.0",
"type": "module",
"files": [
"dist"
],
"main": "./dist/vue-local-scope.umd.cjs",
"module": "./dist/vue-local-scope.js",
"exports": {
".": {
"import": "./dist/vue-local-scope.js",
"require": "./dist/vue-local-scope.umd.cjs"
}
},
"scripts": {
"dev": "vite",
"build": "vue-tsc -b && vite build",
Expand All @@ -13,6 +24,7 @@
},
"devDependencies": {
"@allindevelopers/prettier-config": "^1.0.0",
"@types/node": "^22.8.5",
"@vitejs/plugin-vue": "^5.1.4",
"@vitejs/plugin-vue-jsx": "^4.0.1",
"prettier": "^3.3.3",
Expand Down
16 changes: 16 additions & 0 deletions vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,24 @@
import { resolve } from "node:path";
import { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue";
import vueJsx from "@vitejs/plugin-vue-jsx";

// https://vite.dev/config/
export default defineConfig({
plugins: [vue(), vueJsx()],
build: {
lib: {
entry: resolve(__dirname, "lib/index.ts"),
name: "VueLocalScope",
fileName: "vue-local-scope",
},
rollupOptions: {
external: ["vue"],
output: {
globals: {
vue: "Vue",
},
},
},
},
});

0 comments on commit c216439

Please sign in to comment.