提交 b0afe646 编写于 作者: fxy060608's avatar fxy060608

chore: update prettierignore

上级 ae2b5f2c
......@@ -9,6 +9,7 @@ packages/uni-components/lib
packages/uni-cloud/lib
packages/uni-h5/lib
packages/uni-stat/lib
packages/uni-push/lib
packages/uni-mp-alipay/lib
packages/uni-mp-baidu/lib
packages/uni-mp-kuaishou/lib
......
此差异已折叠。
'use strict'
'use strict';
var path = require('path')
var debug = require('debug')
var uniCliShared = require('@dcloudio/uni-cli-shared')
var path = require('path');
var debug = require('debug');
var uniCliShared = require('@dcloudio/uni-cli-shared');
function _interopDefaultLegacy(e) {
return e && typeof e === 'object' && 'default' in e ? e : { default: e }
}
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
var path__default = /*#__PURE__*/ _interopDefaultLegacy(path)
var debug__default = /*#__PURE__*/ _interopDefaultLegacy(debug)
var path__default = /*#__PURE__*/_interopDefaultLegacy(path);
var debug__default = /*#__PURE__*/_interopDefaultLegacy(debug);
const debugPush = debug__default['default']('uni:push')
const debugPush = debug__default["default"]('uni:push');
var index = () => [
uniCliShared.defineUniMainJsPlugin((opts) => {
let isEnable = false
let isOffline = false
let isEnable = false;
let isOffline = false;
return {
name: 'uni:push',
enforce: 'pre',
config(config, env) {
if (uniCliShared.isSsr(env.command, config)) {
return
return;
}
const inputDir = process.env.UNI_INPUT_DIR
const platform = process.env.UNI_PLATFORM
isOffline =
platform === 'app' && uniCliShared.isUniPushOffline(inputDir)
const inputDir = process.env.UNI_INPUT_DIR;
const platform = process.env.UNI_PLATFORM;
isOffline = platform === 'app' && uniCliShared.isUniPushOffline(inputDir);
if (isOffline) {
isEnable = true
return
isEnable = true;
return;
}
const { appid, enable, debug } = uniCliShared.getUniPush(
inputDir,
platform
)
isEnable = appid && enable === true
const { appid, enable, debug } = uniCliShared.getUniPush(inputDir, platform);
isEnable = appid && enable === true;
if (!isEnable) {
return
return;
}
debugPush('appid', appid, 'deubg', debug)
debugPush('appid', appid, 'deubg', debug);
return {
define: {
'process.env.UNI_PUSH_APP_ID': JSON.stringify(appid),
'process.env.UNI_PUSH_DEBUG': !!debug,
},
}
};
},
resolveId(id) {
if (id === '@dcloudio/uni-push') {
return uniCliShared.resolveBuiltIn(
path__default['default'].join(
'@dcloudio/uni-push',
isOffline ? 'dist/uni-push.plus.es.js' : 'dist/uni-push.es.js'
)
)
return uniCliShared.resolveBuiltIn(path__default["default"].join('@dcloudio/uni-push', isOffline ? 'dist/uni-push.plus.es.js' : 'dist/uni-push.es.js'));
}
},
transform(code, id) {
if (!opts.filter(id)) {
return
return;
}
if (isEnable) {
return {
code: code + `;import '@dcloudio/uni-push';`,
map: null,
}
};
}
},
}
};
}),
]
];
module.exports = index
module.exports = index;
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册