Skip to content

Commit 4879d8a

Browse files
authored
Merge pull request #41 from zernonia/use-unbuild
chore: update bundler to unbuild
2 parents 1e6b447 + 435f7f7 commit 4879d8a

25 files changed

+1106
-1900
lines changed

build.config.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import { resolve } from "path";
2+
import { defineBuildConfig } from "unbuild";
3+
4+
export default defineBuildConfig({
5+
entries: [
6+
{ builder: "mkdist", input: "./src/" },
7+
{ builder: "mkdist", input: "./src/", format: "cjs", ext: "js" },
8+
],
9+
10+
alias: {
11+
"@": resolve(__dirname, "./src"),
12+
},
13+
14+
declaration: true,
15+
clean: true,
16+
});

demo/vue/src/env.d.ts

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

env.d.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
declare module "*.vue" {
2+
import { DefineComponent } from "vue";
3+
const component: DefineComponent<{}, {}, any>;
4+
export default component;
5+
}

nuxt/plugin.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
import VueNotion from "vue3-notion"
2-
import { getPageBlocks, getPageTable } from "vue3-notion"
3-
import { defineNuxtPlugin } from "#app"
1+
import VueNotion from "vue3-notion";
2+
import { getPageBlocks, getPageTable } from "vue3-notion";
3+
import { defineNuxtPlugin } from "#app";
44

55
export default defineNuxtPlugin(({ vueApp }) => {
6-
const notion = { getPageBlocks, getPageTable }
7-
vueApp.use(VueNotion)
6+
const notion = { getPageBlocks, getPageTable };
7+
vueApp.use(VueNotion);
88
return {
99
provide: {
1010
notion,
1111
},
12-
}
13-
})
12+
};
13+
});

package.json

Lines changed: 14 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
"description": "Vue 3 Unofficial Notion Renderer",
55
"homepage": "https://vue3-notion.vercel.app/",
66
"repository": "github:zernonia/vue3-notion",
7-
"main": "./dist/index.umd.js",
8-
"module": "./dist/index.es.js",
7+
"type": "module",
8+
"main": "./dist/index.mjs",
99
"types": "./dist/index.d.ts",
1010
"exports": {
1111
".": {
12-
"import": "./dist/index.es.js",
13-
"require": "./dist/index.umd.js"
12+
"import": "./dist/index.mjs",
13+
"require": "./dist/index.js"
1414
},
1515
"./nuxt": {
1616
"require": "./nuxt/index.ts",
@@ -22,11 +22,8 @@
2222
}
2323
},
2424
"files": [
25-
"dist/**/*.ts",
26-
"dist/**/*.js",
27-
"dist/**/*.d.ts",
28-
"dist/*.css",
29-
"nuxt/*.ts"
25+
"dist",
26+
"nuxt"
3027
],
3128
"keywords": [
3229
"vue",
@@ -37,45 +34,30 @@
3734
],
3835
"license": "MIT",
3936
"scripts": {
40-
"dev": "vite -c vite-dev.config.ts",
41-
"dev:build": "vue-tsc --noEmit && vite build -c vite-dev.config.ts",
42-
"build": "vue-tsc --noEmit && vite build && rollup -c",
43-
"build:rollup": "rollup -c",
44-
"build:types": "vue-tsc --noEmit",
37+
"dev": "vite serve playground",
38+
"dev:build": "vite build playground",
39+
"build": "unbuild",
4540
"preview": "vite preview",
4641
"version": " git add -A src",
4742
"postversion": "git push && git push --tags",
4843
"deploy": "npm run build && npm version patch && npm publish"
4944
},
5045
"dependencies": {
51-
"@nuxt/kit": "^3.0.0-rc.1",
46+
"@nuxt/kit": "^3.4.3",
5247
"@vueuse/core": "^8.7.5",
5348
"katex": "^0.15.1",
54-
"pathe": "^0.2.0",
5549
"prismjs": "^1.25.0",
5650
"vue": "^3.2.26",
5751
"vue-router": "4"
5852
},
5953
"devDependencies": {
60-
"@rollup/plugin-alias": "^3.1.8",
61-
"@rollup/plugin-commonjs": "^21.0.2",
62-
"@rollup/plugin-node-resolve": "^13.1.3",
63-
"@rollup/plugin-replace": "^3.0.0",
6454
"@types/katex": "^0.11.1",
6555
"@types/node": "^17.0.5",
6656
"@types/prismjs": "^1.16.6",
67-
"@vitejs/plugin-vue": "^2.0.0",
68-
"postcss": "^8.4.5",
69-
"rollup": "^2.62.0",
70-
"rollup-plugin-peer-deps-external": "^2.2.4",
71-
"rollup-plugin-postcss": "^4.0.2",
72-
"rollup-plugin-typescript": "^1.0.1",
73-
"rollup-plugin-vue": "^6.0.0",
74-
"tslib": "^2.3.1",
75-
"typescript": "^4.4.4",
76-
"vite": "^2.9.7",
77-
"vite-plugin-dts": "^0.9.10",
78-
"vue-tsc": "^0.34.11"
57+
"@vitejs/plugin-vue": "^4.2.1",
58+
"typescript": "^5.0.4",
59+
"unbuild": "^1.2.1",
60+
"vite": "^4.3.5"
7961
},
8062
"peerDependencies": {
8163
"katex": "^0.15.1",

playground/App.vue

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<template>
2+
<div id="app">
3+
<router-view :key="$route.params.id?.toString()"></router-view>
4+
</div>
5+
</template>
File renamed without changes.

index.html renamed to playground/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@
88
</head>
99
<body>
1010
<div id="app"></div>
11-
<script type="module" src="/src/main.ts"></script>
11+
<script type="module" src="/main.ts"></script>
1212
</body>
1313
</html>

playground/main.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import { createApp } from "vue";
2+
import App from "./App.vue";
3+
import { router } from "./router";
4+
import "@/style.css";
5+
6+
createApp(App).use(router).mount("#app");
File renamed without changes.

0 commit comments

Comments
 (0)