真机报错:
module 'utils/config.js' is not defined, require args is '@utils/config's
使用 miniprogram-ci 编译上传
const project = new ci.Project({
appid: appid,
type: 'miniProgram',
projectPath: './src',
privateKeyPath: keyPath,
ignores: ['node_modules/**/*'],
})
const uploadResult = await ci.upload({
project,
version: process.env.VERSION,
robot: 2,
desc: `${name} ${appid}`,
setting: {
es6: true,
es7 : true,
enhance: true,
minified: true,
ignoreUploadUnusedFiles: true,
},
})
项目结构:
├── LICENSE ├── package-lock.json ├── package.json ├── scripts │ └── ci │ ├── dev.js └── src ├── app.js ├── app.json ├── app.wxss ├── custom-tab-bar ├── miniprogram_npm ├── pages │ ├── tabbar │ ├── home │ ├── home.js ├── project.config.json ├── static └── utils ├── api.js ├── log.js └── util.js
import config from '@utils/config';
import util from '@utils/util';
import API from '@utils/api';
import log from '@utils/log';
"resolveAlias": {
"~/*": "/*",
"@utils/*": "utils/*"
},