feat: initialize taro react typescript miniapp
This commit is contained in:
9
config/dev.ts
Normal file
9
config/dev.ts
Normal 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
52
config/index.ts
Normal 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
13
config/prod.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
import { defineConfig } from "@tarojs/cli";
|
||||
|
||||
export default defineConfig({
|
||||
env: {
|
||||
NODE_ENV: '"production"'
|
||||
},
|
||||
mini: {
|
||||
optimizeMainPackage: {
|
||||
enable: true
|
||||
}
|
||||
},
|
||||
h5: {}
|
||||
});
|
||||
Reference in New Issue
Block a user