Skip to content

Commit 3c528e9

Browse files
committedDec 11, 2024
feat: init
0 parents  commit 3c528e9

11 files changed

+2481
-0
lines changed
 

‎.gitignore

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Local
2+
.DS_Store
3+
*.local
4+
*.log*
5+
6+
# Dist
7+
node_modules
8+
dist/
9+
10+
# IDE
11+
.vscode/*
12+
!.vscode/extensions.json
13+
.idea

‎.vscode/extensions.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"recommendations": ["Vue.volar"]
3+
}

‎README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Vue Macros + Vue 3 + Rsbuild
2+
3+
- Vue 3
4+
- Vue Macros
5+
- Rsbuild
6+
7+
[Documentation](https://vue-macros.dev/)

‎package.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"name": "vue3-rsbuild",
3+
"private": true,
4+
"version": "1.0.0",
5+
"scripts": {
6+
"dev": "rsbuild dev --open",
7+
"build": "rsbuild build",
8+
"preview": "rsbuild preview"
9+
},
10+
"dependencies": {
11+
"@vueuse/core": "^12.0.0",
12+
"vue": "^3.5.13"
13+
},
14+
"devDependencies": {
15+
"@rsbuild/core": "^1.1.9",
16+
"@rsbuild/plugin-vue": "^1.0.5",
17+
"typescript": "^5.7.2",
18+
"unplugin-vue-macros": "^2.13.5"
19+
}
20+
}

‎pnpm-lock.yaml

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

‎rsbuild.config.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import { defineConfig } from '@rsbuild/core'
2+
import { pluginVue } from '@rsbuild/plugin-vue'
3+
import VueMacros from 'unplugin-vue-macros/rspack'
4+
5+
export default defineConfig({
6+
plugins: [pluginVue()],
7+
tools: {
8+
rspack: {
9+
plugins: [VueMacros()],
10+
},
11+
},
12+
})

‎src/App.vue

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<script setup lang="ts">
2+
defineModels<{
3+
foo?: string
4+
}>()
5+
6+
let count = $ref(10)
7+
function inc() {
8+
count++
9+
}
10+
</script>
11+
12+
<template>
13+
<h1>Rsbuild x Vue Macros x Vue 3</h1>
14+
{{ foo }}
15+
<button @click="inc">{{ count }}</button>
16+
</template>

‎src/env.d.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
/// <reference types="@rsbuild/core/types" />
2+
/// <reference types="unplugin-vue-macros/macros-global" />
3+
4+
declare module '*.vue' {
5+
import type { DefineComponent } from 'vue';
6+
7+
// biome-ignore lint/complexity/noBannedTypes: reason
8+
const component: DefineComponent<{}, {}, any>;
9+
export default component;
10+
}

‎src/index.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import { createApp } from 'vue';
2+
import App from './App.vue';
3+
4+
createApp(App).mount('#root');

‎tsconfig.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"compilerOptions": {
3+
"target": "ES2020",
4+
"lib": ["DOM", "ES2020"],
5+
"module": "ESNext",
6+
"jsx": "preserve",
7+
"jsxImportSource": "vue",
8+
"strict": true,
9+
"skipLibCheck": true,
10+
"isolatedModules": true,
11+
"resolveJsonModule": true,
12+
"moduleResolution": "bundler",
13+
"useDefineForClassFields": true
14+
},
15+
"vueCompilerOptions": {
16+
"plugins": ["unplugin-vue-macros/volar"]
17+
},
18+
"include": ["src"]
19+
}

‎vue-macros.config.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import { defineConfig } from 'unplugin-vue-macros'
2+
3+
export default defineConfig({})

0 commit comments

Comments
 (0)
Please sign in to comment.