feat(init): all

This commit is contained in:
2025-12-31 10:44:59 +08:00
commit 4fc473fff2
19 changed files with 2081 additions and 0 deletions

1
apps/demo/env.d.ts vendored Normal file
View File

@@ -0,0 +1 @@
/// <reference types="vite/client" />

12
apps/demo/index.html Normal file
View File

@@ -0,0 +1,12 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Document</title>
</head>
<body>
<div id="app"></div>
<script type="module" src="/src/main.ts"></script>
</body>
</html>

9
apps/demo/package.json Normal file
View File

@@ -0,0 +1,9 @@
{
"name": "@nanxing-admin/demo",
"private": true,
"version": "0.1.0",
"type": "module",
"scripts": {
"dev": "vite"
}
}

3
apps/demo/src/App.vue Normal file
View File

@@ -0,0 +1,3 @@
<template>
<div>Demo</div>
</template>

View File

@@ -0,0 +1 @@
@import 'tailwindcss';

9
apps/demo/src/main.ts Normal file
View File

@@ -0,0 +1,9 @@
import './assets/style/tailwind.css';
import { createApp } from 'vue';
import App from './App.vue';
import { createWebApp } from 'nanxing-admin';
createWebApp();
createApp(App).mount('#app');

9
apps/demo/tsconfig.json Normal file
View File

@@ -0,0 +1,9 @@
{
"extends": "../../tsconfig.app.json",
"include": ["env.d.ts", "src/**/*.vue", "src/**/*.ts", "src/**/*.tsx", "src/**/*.js", "src/**/*.jsx"],
"exclude": ["src/**/__test__", "node_modules", "dist"],
"compilerOptions": {
"types": ["node"],
"allowSyntheticDefaultImports": true
}
}

27
apps/demo/vite.config.ts Normal file
View File

@@ -0,0 +1,27 @@
import { fileURLToPath, URL } from 'node:url';
import { defineConfig } from 'vite';
import vue from '@vitejs/plugin-vue';
import vueJsx from '@vitejs/plugin-vue-jsx';
import tailwindcss from '@tailwindcss/vite';
// https://vitejs.dev/config/
export default defineConfig({
// base: 影响打包静态资源的路径
base: './',
plugins: [vue(), vueJsx(), tailwindcss()],
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url)),
},
},
css: {
preprocessorOptions: {
scss: { api: 'modern-compiler' },
},
},
server: {
host: true,
},
});