Skip to content

Commit da97360

Browse files
committed
fix: missing properties inside package.json, bundle es + umd
1 parent 40067e5 commit da97360

File tree

3 files changed

+24
-9
lines changed

3 files changed

+24
-9
lines changed

package-lock.json

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,28 @@
22
"name": "vue3-select-component",
33
"type": "module",
44
"version": "0.0.0-unreleased",
5+
"description": "A flexible & modern select-input control for Vue 3.",
6+
"author": "Thomas Cazade <cazade.thomas@gmail.com>",
7+
"license": "MIT",
8+
"repository": {
9+
"type": "git",
10+
"url": "https://github.com/TotomInc/vue3-select-component.git"
11+
},
12+
"keywords": ["vue3", "select", "dropdown"],
513
"exports": {
614
".": {
715
"types": "./dist/index.d.ts",
8-
"import": "./dist/index.js"
16+
"import": "./dist/index.es.js",
17+
"require": "./dist/index.umd.js"
918
},
10-
"./style.css": {
11-
"import": "./dist/style.css"
19+
"./dist/style.css": {
20+
"types": "./dist/style.css",
21+
"import": "./dist/style.css",
22+
"require": "./dist/style.css"
1223
}
1324
},
14-
"main": "dist/index.js",
15-
"module": "dist/index.js",
25+
"main": "dist/index.umd.js",
26+
"module": "dist/index.es.js",
1627
"types": "dist/index.d.ts",
1728
"files": ["dist"],
1829
"scripts": {

vite.config.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ import vue from "@vitejs/plugin-vue";
55
import vueDevtools from "vite-plugin-vue-devtools";
66
import dts from "vite-plugin-dts";
77

8+
const resolve = (path: string) => fileURLToPath(new URL(path, import.meta.url));
9+
810
// https://vitejs.dev/config/
911
export default defineConfig({
1012
plugins: [
@@ -15,16 +17,17 @@ export default defineConfig({
1517

1618
resolve: {
1719
alias: {
18-
"@": fileURLToPath(new URL("./src", import.meta.url)),
20+
"@": resolve("./src"),
1921
},
2022
},
2123

2224
build: {
25+
target: "es2015",
2326
lib: {
2427
name: "vue3-select-component",
25-
entry: fileURLToPath(new URL("./src/index.ts", import.meta.url)),
26-
formats: ["es"],
27-
fileName: "index",
28+
entry: resolve("./src/index.ts"),
29+
formats: ["es", "umd"],
30+
fileName: (format) => `index.${format}.js`,
2831
},
2932
rollupOptions: {
3033
external: ["vue"],

0 commit comments

Comments
 (0)