3 Star 2 Fork 6

POLYV/polyv-web-interactions-receive-sdk-ui-default

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
build-entrance.js 1.12 KB
一键复制 编辑 原始数据 按行查看 历史
heweisheng 提交于 2年前 . pr first-commit
const glob = require('glob');
const path = require('path');
const fs = require('fs');
const entryPc = {};
const entryMobile = {};
glob.sync(
path.join('./src/entry', '**', '*.vue'),
).forEach((fullPath) => {
if (fullPath.indexOf('Mobile') > -1) {
// 获取path 文件名
entryMobile[path.basename(fullPath, '.vue')] = fullPath;
} else if (fullPath.indexOf('Pc') > -1) {
entryPc[path.basename(fullPath, '.vue')] = fullPath;
} else {
entryMobile[path.basename(fullPath, '.vue')] = fullPath;
entryPc[path.basename(fullPath, '.vue')] = fullPath;
}
});
let entryMobileStr = '';
let entryPcStr = '';
for (const key in entryMobile) {
const appPath = '../../' + entryMobile[key];
entryMobileStr += '\n' + `export { default as ${key} } from '${appPath}';`;
}
entryMobileStr += '\n';
for (const key in entryPc) {
const appPath = '../../' + entryPc[key];
entryPcStr += '\n' + `export { default as ${key} } from '${appPath}';`;
}
entryPcStr += '\n';
// 在src/entrance目录下写入文件
fs.writeFileSync('./src/entrance/entranceMobile.js', entryMobileStr);
fs.writeFileSync('./src/entrance/entrancePc.js', entryPcStr);
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
JavaScript
1
https://gitee.com/polyv_ef/polyv-web-interactions-receive-sdk-ui-default.git
git@gitee.com:polyv_ef/polyv-web-interactions-receive-sdk-ui-default.git
polyv_ef
polyv-web-interactions-receive-sdk-ui-default
polyv-web-interactions-receive-sdk-ui-default
master

搜索帮助