This commit is contained in:
熊潇 2025-04-02 18:18:15 +08:00
parent fa0cbdeae3
commit 5416cdab28
3 changed files with 52 additions and 0 deletions

View File

@ -7,10 +7,15 @@
"scripts": { "scripts": {
"dev": "vite", "dev": "vite",
"build": "vite build", "build": "vite build",
"build:css": "tailwindcss -i ./src/index.css -o ./dist/render.css --minify",
"postbuild2": "pnpm build:css",
"preview": "vite preview", "preview": "vite preview",
"pub": "envision deploy ./dist -k vite-react -v 0.0.1", "pub": "envision deploy ./dist -k vite-react -v 0.0.1",
"dev:lib": "turbo dev" "dev:lib": "turbo dev"
}, },
"files": [
"dist"
],
"author": "abearxiong <xiongxiao@xiongxiao.me>", "author": "abearxiong <xiongxiao@xiongxiao.me>",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
@ -25,6 +30,9 @@
"react-toastify": "^11.0.5", "react-toastify": "^11.0.5",
"zustand": "^5.0.3" "zustand": "^5.0.3"
}, },
"publishConfig": {
"access": "public"
},
"devDependencies": { "devDependencies": {
"@kevisual/query": "0.0.15", "@kevisual/query": "0.0.15",
"@kevisual/types": "^0.0.6", "@kevisual/types": "^0.0.6",

38
public/demo.html Normal file
View File

@ -0,0 +1,38 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Excalidraw</title>
<style>
html,
body {
margin: 0;
padding: 0;
width: 100%;
height: 100%;
overflow: hidden;
}
#root {
width: 100%;
height: 100%;
}
</style>
<link rel="stylesheet" crossorigin href="./render.css">
</head>
<body>
<div id="root"></div>
<script type="module">
import { render } from './render.js';
console.log('render', render);
const opts = {
renderRoot: document.getElementById('root'),
}
render(opts);
</script>
</body>
</html>

View File

@ -58,9 +58,15 @@ export default defineConfig({
DEV_SERVER: JSON.stringify(process.env.NODE_ENV === 'development'), DEV_SERVER: JSON.stringify(process.env.NODE_ENV === 'development'),
VERSION: JSON.stringify(version), VERSION: JSON.stringify(version),
BASE_NAME: JSON.stringify(basename), BASE_NAME: JSON.stringify(basename),
'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV),
}, },
build: { build: {
target: 'modules', target: 'modules',
// lib: {
// entry: './src/libs.ts',
// formats: ['es'],
// fileName: (format) => `render.js`,
// },
}, },
server: { server: {
port: 7006, port: 7006,