create-weapp-vite 1.2.0 → 1.3.0

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.
Files changed (174) hide show
  1. package/dist/chunk-CI2UMYKK.js +277 -0
  2. package/dist/cli.cjs +280 -11
  3. package/dist/cli.js +12 -9
  4. package/dist/index.cjs +317 -0
  5. package/dist/index.d.cts +11 -1
  6. package/dist/index.d.ts +11 -1
  7. package/dist/index.js +8 -0
  8. package/package.json +6 -3
  9. package/templates/default/.editorconfig +9 -0
  10. package/templates/default/.vscode/settings.json +5 -0
  11. package/templates/default/README.md +28 -0
  12. package/templates/default/auto-import-components.json +3 -0
  13. package/templates/default/gitignore +35 -0
  14. package/templates/default/package.json +31 -0
  15. package/templates/default/project.config.json +42 -0
  16. package/templates/default/project.private.config.json +8 -0
  17. package/templates/default/public/logo.png +0 -0
  18. package/templates/default/src/app.json +10 -0
  19. package/templates/default/src/app.scss +0 -0
  20. package/templates/default/src/app.ts +6 -0
  21. package/templates/default/src/components/HelloWorld/HelloWorld.json +6 -0
  22. package/templates/default/src/components/HelloWorld/HelloWorld.scss +47 -0
  23. package/templates/default/src/components/HelloWorld/HelloWorld.ts +61 -0
  24. package/templates/default/src/components/HelloWorld/HelloWorld.wxml +16 -0
  25. package/templates/default/src/pages/index/index.json +7 -0
  26. package/templates/default/src/pages/index/index.scss +0 -0
  27. package/templates/default/src/pages/index/index.ts +24 -0
  28. package/templates/default/src/pages/index/index.wxml +14 -0
  29. package/templates/default/src/sitemap.json +10 -0
  30. package/templates/default/src/theme.json +5 -0
  31. package/templates/default/src/utils/util.ts +3 -0
  32. package/templates/default/src/vite-env.d.ts +1 -0
  33. package/templates/default/tsconfig.app.json +57 -0
  34. package/templates/default/tsconfig.json +11 -0
  35. package/templates/default/tsconfig.node.json +33 -0
  36. package/templates/default/vite.config.ts +39 -0
  37. package/templates/tailwindcss/.editorconfig +9 -0
  38. package/templates/tailwindcss/.vscode/settings.json +5 -0
  39. package/templates/tailwindcss/README.md +28 -0
  40. package/templates/tailwindcss/auto-import-components.json +3 -0
  41. package/templates/tailwindcss/gitignore +35 -0
  42. package/templates/tailwindcss/package.json +38 -0
  43. package/templates/tailwindcss/postcss.config.js +6 -0
  44. package/templates/tailwindcss/project.config.json +43 -0
  45. package/templates/tailwindcss/project.private.config.json +8 -0
  46. package/templates/tailwindcss/public/icon0.png +0 -0
  47. package/templates/tailwindcss/public/icon0s.png +0 -0
  48. package/templates/tailwindcss/public/icon1.png +0 -0
  49. package/templates/tailwindcss/public/icon1s.png +0 -0
  50. package/templates/tailwindcss/public/logo.png +0 -0
  51. package/templates/tailwindcss/src/app.json +31 -0
  52. package/templates/tailwindcss/src/app.scss +3 -0
  53. package/templates/tailwindcss/src/app.ts +6 -0
  54. package/templates/tailwindcss/src/components/HelloWorld/HelloWorld.json +7 -0
  55. package/templates/tailwindcss/src/components/HelloWorld/HelloWorld.scss +1 -0
  56. package/templates/tailwindcss/src/components/HelloWorld/HelloWorld.ts +61 -0
  57. package/templates/tailwindcss/src/components/HelloWorld/HelloWorld.wxml +16 -0
  58. package/templates/tailwindcss/src/pages/index/index.json +7 -0
  59. package/templates/tailwindcss/src/pages/index/index.scss +0 -0
  60. package/templates/tailwindcss/src/pages/index/index.ts +48 -0
  61. package/templates/tailwindcss/src/pages/index/index.wxml +24 -0
  62. package/templates/tailwindcss/src/pages/profile/index.json +7 -0
  63. package/templates/tailwindcss/src/pages/profile/index.scss +0 -0
  64. package/templates/tailwindcss/src/pages/profile/index.ts +19 -0
  65. package/templates/tailwindcss/src/pages/profile/index.wxml +11 -0
  66. package/templates/tailwindcss/src/sitemap.json +10 -0
  67. package/templates/tailwindcss/src/theme.json +5 -0
  68. package/templates/tailwindcss/src/utils/util.ts +3 -0
  69. package/templates/tailwindcss/src/vite-env.d.ts +1 -0
  70. package/templates/tailwindcss/tailwind.config.ts +22 -0
  71. package/templates/tailwindcss/tsconfig.app.json +57 -0
  72. package/templates/tailwindcss/tsconfig.json +11 -0
  73. package/templates/tailwindcss/tsconfig.node.json +33 -0
  74. package/templates/tailwindcss/vite.config.ts +37 -0
  75. package/templates/tdesign/.editorconfig +9 -0
  76. package/templates/tdesign/.vscode/settings.json +5 -0
  77. package/templates/tdesign/README.md +28 -0
  78. package/templates/tdesign/gitignore +35 -0
  79. package/templates/tdesign/package.json +41 -0
  80. package/templates/tdesign/postcss.config.js +6 -0
  81. package/templates/tdesign/project.config.json +45 -0
  82. package/templates/tdesign/project.private.config.json +8 -0
  83. package/templates/tdesign/public/logo.png +0 -0
  84. package/templates/tdesign/src/app.json +10 -0
  85. package/templates/tdesign/src/app.scss +3 -0
  86. package/templates/tdesign/src/app.ts +6 -0
  87. package/templates/tdesign/src/components/HelloWorld/HelloWorld.json +8 -0
  88. package/templates/tdesign/src/components/HelloWorld/HelloWorld.scss +1 -0
  89. package/templates/tdesign/src/components/HelloWorld/HelloWorld.ts +64 -0
  90. package/templates/tdesign/src/components/HelloWorld/HelloWorld.wxml +17 -0
  91. package/templates/tdesign/src/pages/index/index.json +7 -0
  92. package/templates/tdesign/src/pages/index/index.scss +0 -0
  93. package/templates/tdesign/src/pages/index/index.ts +97 -0
  94. package/templates/tdesign/src/pages/index/index.wxml +24 -0
  95. package/templates/tdesign/src/sitemap.json +10 -0
  96. package/templates/tdesign/src/theme.json +5 -0
  97. package/templates/tdesign/src/utils/util.ts +3 -0
  98. package/templates/tdesign/src/vite-env.d.ts +1 -0
  99. package/templates/tdesign/tailwind.config.ts +22 -0
  100. package/templates/tdesign/tsconfig.app.json +60 -0
  101. package/templates/tdesign/tsconfig.json +11 -0
  102. package/templates/tdesign/tsconfig.node.json +33 -0
  103. package/templates/tdesign/vite.config.ts +41 -0
  104. package/templates/vant/.editorconfig +9 -0
  105. package/templates/vant/.vscode/settings.json +5 -0
  106. package/templates/vant/README.md +28 -0
  107. package/templates/vant/gitignore +35 -0
  108. package/templates/vant/package.json +41 -0
  109. package/templates/vant/postcss.config.js +6 -0
  110. package/templates/vant/project.config.json +42 -0
  111. package/templates/vant/project.private.config.json +8 -0
  112. package/templates/vant/public/logo.png +0 -0
  113. package/templates/vant/src/app.json +10 -0
  114. package/templates/vant/src/app.scss +3 -0
  115. package/templates/vant/src/app.ts +6 -0
  116. package/templates/vant/src/components/HelloWorld/HelloWorld.json +9 -0
  117. package/templates/vant/src/components/HelloWorld/HelloWorld.scss +1 -0
  118. package/templates/vant/src/components/HelloWorld/HelloWorld.ts +61 -0
  119. package/templates/vant/src/components/HelloWorld/HelloWorld.wxml +19 -0
  120. package/templates/vant/src/pages/index/index.json +7 -0
  121. package/templates/vant/src/pages/index/index.scss +0 -0
  122. package/templates/vant/src/pages/index/index.ts +57 -0
  123. package/templates/vant/src/pages/index/index.wxml +28 -0
  124. package/templates/vant/src/sitemap.json +10 -0
  125. package/templates/vant/src/theme.json +5 -0
  126. package/templates/vant/src/utils/util.ts +3 -0
  127. package/templates/vant/src/vite-env.d.ts +1 -0
  128. package/templates/vant/tailwind.config.ts +22 -0
  129. package/templates/vant/tsconfig.app.json +60 -0
  130. package/templates/vant/tsconfig.json +11 -0
  131. package/templates/vant/tsconfig.node.json +33 -0
  132. package/templates/vant/vite.config.ts +41 -0
  133. package/templates/wevu/.editorconfig +9 -0
  134. package/templates/wevu/.vscode/settings.json +5 -0
  135. package/templates/wevu/README.md +29 -0
  136. package/templates/wevu/auto-import-components.json +1 -0
  137. package/templates/wevu/gitignore +35 -0
  138. package/templates/wevu/package.json +30 -0
  139. package/templates/wevu/project.config.json +43 -0
  140. package/templates/wevu/project.private.config.json +8 -0
  141. package/templates/wevu/public/logo.png +0 -0
  142. package/templates/wevu/src/app.vue +36 -0
  143. package/templates/wevu/src/components/HelloWorld/index.vue +45 -0
  144. package/templates/wevu/src/pages/index/index.vue +138 -0
  145. package/templates/wevu/src/sitemap.json +10 -0
  146. package/templates/wevu/src/theme.json +5 -0
  147. package/templates/wevu/src/vite-env.d.ts +1 -0
  148. package/templates/wevu/tsconfig.app.json +57 -0
  149. package/templates/wevu/tsconfig.json +11 -0
  150. package/templates/wevu/tsconfig.node.json +33 -0
  151. package/templates/wevu/vite.config.ts +8 -0
  152. package/templates/wevu-tdesign/.editorconfig +9 -0
  153. package/templates/wevu-tdesign/.vscode/settings.json +5 -0
  154. package/templates/wevu-tdesign/README.md +29 -0
  155. package/templates/wevu-tdesign/auto-import-components.json +83 -0
  156. package/templates/wevu-tdesign/components.d.ts +183 -0
  157. package/templates/wevu-tdesign/gitignore +35 -0
  158. package/templates/wevu-tdesign/package.json +40 -0
  159. package/templates/wevu-tdesign/postcss.config.js +6 -0
  160. package/templates/wevu-tdesign/project.config.json +43 -0
  161. package/templates/wevu-tdesign/project.private.config.json +8 -0
  162. package/templates/wevu-tdesign/public/logo.png +0 -0
  163. package/templates/wevu-tdesign/src/app.vue +35 -0
  164. package/templates/wevu-tdesign/src/components/HelloWorld/index.vue +23 -0
  165. package/templates/wevu-tdesign/src/pages/index/index.vue +161 -0
  166. package/templates/wevu-tdesign/src/sitemap.json +10 -0
  167. package/templates/wevu-tdesign/src/theme.json +5 -0
  168. package/templates/wevu-tdesign/src/vite-env.d.ts +1 -0
  169. package/templates/wevu-tdesign/tailwind.config.ts +22 -0
  170. package/templates/wevu-tdesign/tsconfig.app.json +62 -0
  171. package/templates/wevu-tdesign/tsconfig.json +11 -0
  172. package/templates/wevu-tdesign/tsconfig.node.json +33 -0
  173. package/templates/wevu-tdesign/typed-components.d.ts +943 -0
  174. package/templates/wevu-tdesign/vite.config.ts +43 -0
@@ -0,0 +1,43 @@
1
+ import { UnifiedViteWeappTailwindcssPlugin } from 'weapp-tailwindcss/vite'
2
+ import { TDesignResolver } from 'weapp-vite/auto-import-components/resolvers'
3
+ import { defineConfig } from 'weapp-vite/config'
4
+
5
+ export default defineConfig({
6
+ weapp: {
7
+ srcRoot: 'src',
8
+ autoImportComponents: {
9
+ resolvers: [TDesignResolver()],
10
+ typedComponents: true,
11
+ vueComponents: true,
12
+ },
13
+ // pnpm g 生成的格式
14
+ // https://vite.icebreaker.top/guide/generate.html
15
+ generate: {
16
+ extensions: {
17
+ js: 'ts',
18
+ wxss: 'scss',
19
+ },
20
+ dirs: {
21
+ component: 'src/components',
22
+ page: 'src/pages',
23
+ },
24
+ // 假如你想让默认生成的组件命名为 HelloWorld/index 而不是 HelloWorld/HelloWorld 可以下列选项
25
+ // filenames: {
26
+ // component: 'index',
27
+ // page: 'index',
28
+ // },
29
+ },
30
+ },
31
+ css: {
32
+ preprocessorOptions: {
33
+ scss: {
34
+ silenceDeprecations: ['legacy-js-api', 'import'],
35
+ },
36
+ },
37
+ },
38
+ plugins: [
39
+ UnifiedViteWeappTailwindcssPlugin({
40
+ rem2rpx: true,
41
+ }),
42
+ ],
43
+ })