forked from dcloudio/uni-app
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
23 changed files
with
1,431 additions
and
103 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
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
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,36 @@ | ||
package.json 是一个可选的配置文件,如果项目的根目录中存在这个文件,且根节点下含有`uni-app`节点,则支持自定义条件编译平台(如钉钉小程序、H5-weixin等)。 | ||
|
||
如下是一个自定义微信服务号平台(H5-WEIXIN)的示例配置: | ||
|
||
```json | ||
"uni-app": { | ||
"scripts": { | ||
"h5-weixin": { //自定义编译平台配置,可通过cli方式调用 | ||
"env": {//环境变量 | ||
"UNI_PLATFORM": "h5" //基准平台 | ||
}, | ||
"define": { //自定义条件编译 | ||
"H5-WEIXIN": true //自定义常量,建议为大写 | ||
} | ||
} | ||
} | ||
} | ||
``` | ||
|
||
开发者可在代码块中使用`H5-WEIXIN`变量,如下: | ||
|
||
``` | ||
// #ifdef H5-WEIXIN | ||
微信服务号特有代码 | ||
// #endif | ||
``` | ||
|
||
开发者可通过如下命令,启动微信服务号平台(H5-WEIXIN)平台的编译: | ||
``` | ||
npm run dev:custom h5-weixin | ||
npm run build:custom h5-weixin | ||
``` | ||
|
||
Tips: | ||
|
||
- `UNI_PLATFORM`仅支持填写`uni-app`默认支持的基准平台,目前仅限如下枚举值:`app-plus`、`h5`、`mp-weixin`、`mp-alipay`、`mp-baidu`、`mp-toutiao`、`mp-qq`。 |
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,18 @@ | ||
vue.config.js 是一个可选的配置文件,如果项目的根目录中存在这个文件,那么它会被自动加载,具体规范参考:[vue-config.js](https://cli.vuejs.org/zh/config/#vue-config-js) | ||
|
||
**支持情况** | ||
* CLI 工程 | ||
* HBuilderX 2.1.5 及以上版本 | ||
|
||
**注意事项** | ||
|
||
部分配置项会被编译配置覆盖,例如: | ||
|
||
* publicPath 不支持,如果需要配置,请在 manifest.json->h5->router->base 中配置,参考文档:[h5-router](collocation/manifest?id=h5-router) | ||
* outputDir 不支持 | ||
* assetsDir 固定 static | ||
* pages 不支持 | ||
* runtimeCompiler 固定 false | ||
* productionSourceMap 固定 false | ||
* css.extract H5 平台固定 false,其他平台固定 true | ||
* parallel 固定 false |
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
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
Large diffs are not rendered by default.
Oops, something went wrong.
Oops, something went wrong.