-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #124 from j10ccc/chore/taro-migrate
chore(taro): migrate configure to taro@4
- Loading branch information
Showing
23 changed files
with
2,427 additions
and
4,921 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,12 @@ | ||
# BaseUrl | ||
HOST=https://sample.com | ||
# 电费的模板id | ||
ELECTRICITY_SUBSCRIBE_TEMPLID= | ||
# 小程序运行时的变量,需要添加 VITE 前缀 | ||
|
||
# 服务端请求地址 | ||
VITE_HOST= | ||
# 电费通知的模板 id | ||
VITE_ELECTRICITY_SUBSCRIBE_TEMPLATE_ID= | ||
|
||
|
||
# Taro 构建插件的变量,需要添加 TARO 前缀 | ||
|
||
# 小程序的 appid,会被自动填写到 dist/project.config.json | ||
TARO_APP_ID= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,4 +6,7 @@ node_modules/ | |
.DS_Store | ||
.idea | ||
.swc | ||
|
||
.env | ||
.env.development | ||
.env.production |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,7 @@ module.exports = { | |
{ | ||
framework: "vue3", | ||
ts: true, | ||
loose: false | ||
compiler: "vite" | ||
} | ||
] | ||
] | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import type { UserConfigExport } from "@tarojs/cli"; | ||
|
||
export default { | ||
mini: {}, | ||
h5: {} | ||
} satisfies UserConfigExport<"vite">; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
import { UserConfigExport, defineConfig } from "@tarojs/cli"; | ||
import devConfig from "./dev"; | ||
import prodConfig from "./prod"; | ||
import path from "path"; | ||
|
||
export default defineConfig<"vite">(async (merge) => { | ||
const baseConfig: UserConfigExport<"vite"> = { | ||
projectName: "WeJh-Taro", | ||
date: "2021-4-20", | ||
designWidth: 750, | ||
deviceRatio: { | ||
640: 2.34 / 2, | ||
750: 1, | ||
375: 2, | ||
828: 1.81 / 2 | ||
}, | ||
sourceRoot: "src", | ||
outputRoot: "dist", | ||
copy: { | ||
patterns: [], | ||
options: {} | ||
}, | ||
plugins: [], | ||
framework: "vue3", | ||
compiler: "vite", | ||
alias: { | ||
"@": path.resolve(__dirname, "..", "src") | ||
}, | ||
mini: { | ||
postcss: { | ||
htmltransform: { | ||
enable: false | ||
}, | ||
pxtransform: { | ||
enable: true, | ||
config: {} | ||
}, | ||
cssModules: { | ||
enable: true, // 默认为 false,如需使用 css modules 功能,则设为 true | ||
config: { | ||
namingPattern: "module", // 转换模式,取值为 global/module | ||
generateScopedName: "[name]__[local]___[hash:base64:5]" | ||
} | ||
} | ||
} | ||
} | ||
}; | ||
|
||
if (process.env.NODE_ENV === "development") { | ||
return merge({}, baseConfig, devConfig); | ||
} | ||
|
||
return merge({}, baseConfig, prodConfig); | ||
}); |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import type { UserConfigExport } from "@tarojs/cli"; | ||
|
||
export default { | ||
mini: {}, | ||
h5: {} | ||
} satisfies UserConfigExport<"vite">; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.