Skip to content

Commit 1ef94a9

Browse files
feat: Migrate build configuration to vite
1 parent 7ec4b50 commit 1ef94a9

File tree

8 files changed

+74
-58
lines changed

8 files changed

+74
-58
lines changed

package.json

Lines changed: 13 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,15 @@
22
"name": "@siren/vue-inbox",
33
"version": "1.0.0",
44
"description": "Vue SDK for in-app notification inbox",
5-
"main": "dist/index.js",
6-
"types": "dist.type.d.ts",
5+
"main": "./dist/@siren/vue-inbox.umd.cjs",
6+
"types": "./dist/@siren/index.d.ts",
77
"type": "module",
8+
"module": "./dist/@siren/vue-inbox.js",
89
"scripts": {
9-
"build": "rm -rf dist && rollup -c",
10-
"prepare": "husky",
11-
"lint": "eslint src"
10+
"dev": "vite",
11+
"build": "vite build && vue-tsc",
12+
"types": "vue-tsc ",
13+
"preview": "vite preview"
1214
},
1315
"repository": {
1416
"type": "git",
@@ -26,25 +28,16 @@
2628
"url": "https://github.com/KeyValueSoftwareSystems/siren-vue-inbox/issues"
2729
},
2830
"homepage": "https://github.com/KeyValueSoftwareSystems/siren-vue-inbox#readme",
29-
"dependencies": {
30-
"@vue/eslint-config-airbnb": "^8.0.0",
31-
"@vue/eslint-config-prettier": "^9.0.0",
32-
"@vue/eslint-config-typescript": "^12.0.0",
33-
"eslint": "^8.57.0",
34-
"eslint-plugin-vue": "^9.22.0",
35-
"husky": "^9.0.11",
36-
"test_notification": "^1.0.5",
31+
"devDependencies": {
32+
"@vitejs/plugin-vue": "^5.0.4",
33+
"path": "^0.12.7",
3734
"typescript": "^5.3.3",
35+
"vite": "^5.1.6",
36+
"vite-plugin-css-injected-by-js": "^3.4.0",
3837
"vue-tsc": "^2.0.5"
3938
},
40-
"devDependencies": {
41-
"@rollup/plugin-terser": "^0.4.4",
42-
"@vue/tsconfig": "^0.5.1",
43-
"rollup-plugin-typescript2": "^0.36.0",
44-
"rollup-plugin-vue": "^6.0.0"
45-
},
4639
"peerDependencies": {
47-
"vue": "^3.4.15"
40+
"vue": "^3.4.21"
4841
},
4942
"files": [
5043
"dist",

rollup.config.js

Lines changed: 0 additions & 16 deletions
This file was deleted.

src/components/SirenInbox.vue

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<template>
2+
Siren
3+
</template>

src/index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import SirenInbox from "./components/SirenInbox.vue";
2+
3+
export { SirenInbox };

src/index.vue

Lines changed: 0 additions & 8 deletions
This file was deleted.

tsconfig.json

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,24 @@
11
{
2-
"extends": "@vue/tsconfig/tsconfig.dom.json",
32
"compilerOptions": {
4-
"allowJs": true,
5-
"allowSyntheticDefaultImports": true,
6-
"forceConsistentCasingInFileNames": true,
7-
"noFallthroughCasesInSwitch": true,
8-
"declaration": true,
9-
"rootDir": ".",
10-
"target": "es5",
11-
"module": "esnext",
12-
"outDir": "dist",
13-
"declarationDir": "dist",
3+
"target": "ES2020",
4+
"useDefineForClassFields": true,
5+
"module": "ESNext",
6+
"lib": ["ES2020", "DOM", "DOM.Iterable"],
7+
"skipLibCheck": true,
8+
"moduleResolution": "bundler",
9+
"allowImportingTsExtensions": true,
10+
"noEmit": true,
11+
"resolveJsonModule": true,
12+
"isolatedModules": true,
13+
"jsx": "preserve",
14+
"declaration": true,
15+
"strict": true,
16+
"noUnusedLocals": true,
17+
"noUnusedParameters": true,
18+
"noFallthroughCasesInSwitch": true
1419
},
15-
"include": ["./"],
16-
"exclude": ["node_modules"]
17-
}
20+
"include": ["src/**/*.ts", "src/**/*.css", "src/**/*.d.ts", "src/**/*.tsx", "src/components/*.vue"],
21+
"exclude": ["node_modules"],
22+
"references": [{ "path": "./tsconfig.node.json" }]
23+
}
24+

tsconfig.node.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"compilerOptions": {
3+
"composite": true,
4+
"skipLibCheck": true,
5+
"module": "ESNext",
6+
"moduleResolution": "bundler",
7+
"allowSyntheticDefaultImports": true
8+
},
9+
"include": ["vite.config.ts"]
10+
}
11+

vite.config.ts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import { defineConfig } from "vite";
2+
import path from "path";
3+
import vue from "@vitejs/plugin-vue";
4+
import cssInjectedByJsPlugin from "vite-plugin-css-injected-by-js";
5+
6+
export default defineConfig({
7+
plugins: [vue(), cssInjectedByJsPlugin()],
8+
build: {
9+
lib: {
10+
entry: path.resolve(__dirname, "src/index.ts"),
11+
name: "Siren",
12+
fileName: "@siren/vue-inbox",
13+
},
14+
rollupOptions: {
15+
external: ["vue"],
16+
output: {
17+
globals: {
18+
vue: "Vue",
19+
},
20+
},
21+
},
22+
},
23+
});

0 commit comments

Comments
 (0)