feat: initialize taro react typescript miniapp

This commit is contained in:
czz
2026-05-07 14:41:39 +08:00
commit 5a98d4afe7
18 changed files with 17606 additions and 0 deletions

9
config/dev.ts Normal file
View File

@@ -0,0 +1,9 @@
import { defineConfig } from "@tarojs/cli";
export default defineConfig({
env: {
NODE_ENV: '"development"'
},
mini: {},
h5: {}
});

52
config/index.ts Normal file
View File

@@ -0,0 +1,52 @@
import { defineConfig } from "@tarojs/cli";
export default defineConfig({
projectName: "wechat-miniapp-starter",
date: "2026-05-07",
designWidth: 750,
deviceRatio: {
640: 2.34 / 2,
750: 1,
828: 1.81 / 2
},
sourceRoot: "src",
outputRoot: "dist",
plugins: [],
defineConstants: {},
copy: {
patterns: [],
options: {}
},
framework: "react",
compiler: {
type: "webpack5"
},
cache: {
enable: false
},
mini: {
postcss: {
pxtransform: {
enable: true,
config: {}
},
url: {
enable: true,
config: {
limit: 1024
}
},
cssModules: {
enable: false,
config: {
namingPattern: "module",
generateScopedName: "[name]__[local]___[hash:base64:5]"
}
}
}
},
h5: {
publicPath: "/",
staticDirectory: "static"
}
});

13
config/prod.ts Normal file
View File

@@ -0,0 +1,13 @@
import { defineConfig } from "@tarojs/cli";
export default defineConfig({
env: {
NODE_ENV: '"production"'
},
mini: {
optimizeMainPackage: {
enable: true
}
},
h5: {}
});