create-lve 0.3.2 → 0.3.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-lve",
3
- "version": "0.3.2",
3
+ "version": "0.3.3",
4
4
  "bin": {
5
5
  "create-lve": "index.js"
6
6
  },
@@ -13,8 +13,7 @@ dist-ssr
13
13
  *.local
14
14
 
15
15
  # Editor directories and files
16
- .vscode/*
17
- !.vscode/extensions.json
16
+ !.vscode/*
18
17
  .idea
19
18
  .DS_Store
20
19
  *.suo
@@ -1,7 +1,10 @@
1
- import { defineConfig } from 'vite-plus'
1
+ import { defineConfig, loadEnv } from 'vite-plus'
2
2
  import react from '@vitejs/plugin-react'
3
3
  import { fileURLToPath, URL } from 'node:url'
4
4
 
5
+ const mode = process.env.NODE_ENV || 'development'
6
+ const env = loadEnv(mode, process.cwd(), '')
7
+
5
8
  // https://vite.dev/config/
6
9
  export default defineConfig({
7
10
  fmt: { semi: false, singleQuote: true },
@@ -15,11 +18,20 @@ export default defineConfig({
15
18
  plugins: [['babel-plugin-react-compiler', { target: '19' }]],
16
19
  },
17
20
  }),
18
- resolve: {
19
- alias: {
20
- '@': fileURLToPath(new URL('./src', import.meta.url)),
21
- },
22
- },
23
21
  /* VITE_PLUS_PLUGINS */
24
22
  ],
23
+ resolve: {
24
+ alias: {
25
+ '@': fileURLToPath(new URL('./src', import.meta.url)),
26
+ },
27
+ },
28
+ server: {
29
+ proxy: {
30
+ '/api': {
31
+ target: env.VITE_DIFY_API_URL,
32
+ changeOrigin: true,
33
+ rewrite: (path) => path.replace(/^\/api/, ''),
34
+ },
35
+ },
36
+ },
25
37
  })
@@ -0,0 +1,56 @@
1
+ {
2
+ // ==================== Formatter (OXC) ====================
3
+ "editor.defaultFormatter": "oxc.oxc-vscode",
4
+ "editor.formatOnSave": true,
5
+ "editor.formatOnSaveMode": "file",
6
+ "oxc.enable.oxfmt": true,
7
+
8
+ // 语言特定 Formatter
9
+ "[javascript]": {
10
+ "editor.defaultFormatter": "oxc.oxc-vscode"
11
+ },
12
+ "[typescript]": {
13
+ "editor.defaultFormatter": "oxc.oxc-vscode"
14
+ },
15
+ "[typescriptreact]": {
16
+ "editor.defaultFormatter": "oxc.oxc-vscode"
17
+ },
18
+ "[javascriptreact]": {
19
+ "editor.defaultFormatter": "oxc.oxc-vscode"
20
+ },
21
+ "[css]": {
22
+ "editor.defaultFormatter": "oxc.oxc-vscode"
23
+ },
24
+ "[tailwindcss]": {
25
+ "editor.defaultFormatter": "oxc.oxc-vscode"
26
+ },
27
+ "[json]": {
28
+ "editor.defaultFormatter": "oxc.oxc-vscode"
29
+ },
30
+ "[jsonc]": {
31
+ "editor.defaultFormatter": "oxc.oxc-vscode"
32
+ },
33
+ "[html]": {
34
+ "editor.defaultFormatter": "oxc.oxc-vscode"
35
+ },
36
+ "[vue]": {
37
+ "editor.defaultFormatter": "oxc.oxc-vscode"
38
+ },
39
+
40
+ // ==================== Tailwind + shadcn/ui(强烈推荐)===================
41
+ "tailwindCSS.experimental.classRegex": [["cn\\(([^)]*)\\)", "(?:'|\"|`)([^']*)(?:'|\"|`)"]],
42
+ "tailwindCSS.includeLanguages": {
43
+ "typescript": "html",
44
+ "typescriptreact": "html"
45
+ },
46
+ "editor.quickSuggestions": {
47
+ "strings": "on"
48
+ },
49
+
50
+ // ==================== 其他项目通用 ====================
51
+ "git.openRepositoryInParentFolders": "always",
52
+ "js/ts.updateImportsOnFileMove.enabled": "always",
53
+ "diffEditor.ignoreTrimWhitespace": true,
54
+ "diffEditor.hideUnchangedRegions.enabled": true,
55
+ "editor.inlayHints.enabled": "on"
56
+ }
@@ -1,5 +1,9 @@
1
- import { defineConfig } from 'vite-plus'
1
+ import { defineConfig, loadEnv } from 'vite-plus'
2
2
  import vue from '@vitejs/plugin-vue'
3
+ import { fileURLToPath, URL } from 'node:url'
4
+
5
+ const mode = process.env.NODE_ENV || 'development'
6
+ const env = loadEnv(mode, process.cwd(), '')
3
7
 
4
8
  // https://vite.dev/config/
5
9
  export default defineConfig({
@@ -12,4 +16,18 @@ export default defineConfig({
12
16
  vue(),
13
17
  /* VITE_PLUS_PLUGINS */
14
18
  ],
19
+ resolve: {
20
+ alias: {
21
+ '@': fileURLToPath(new URL('./src', import.meta.url)),
22
+ },
23
+ },
24
+ server: {
25
+ proxy: {
26
+ '/api': {
27
+ target: env.VITE_DIFY_API_URL,
28
+ changeOrigin: true,
29
+ rewrite: (path) => path.replace(/^\/api/, ''),
30
+ },
31
+ },
32
+ },
15
33
  })