增加快速启动的研发模式fast
This commit is contained in:
@@ -14,30 +14,47 @@ export default {
|
||||
},
|
||||
loadApps() {
|
||||
//新App的自动化格式
|
||||
waiting.init({innerHTML: '应用加载中..'})
|
||||
let apps = require.context('../../', true, /\.(\/.+)\/App[A-Z][^\/]+\.vue$/, "lazy")
|
||||
Promise.all(apps.keys().map(path => apps(path).then(file => {
|
||||
if (file.default) {
|
||||
let {name, label} = file.default,
|
||||
addApp = {
|
||||
name: path.replace(/\.\/?(vue)?/g, '')?.split("/").join("_"), label: label || name,
|
||||
path: path.replace(/\.(\/.+\/App.+)\.vue$/, '$1'),
|
||||
component: appEntry,
|
||||
module: file.default
|
||||
}
|
||||
waiting.setContent(`加载${name}...`)
|
||||
router.addRoute(addApp)
|
||||
//命名规范入口文件必须以App开头
|
||||
return store.commit("addApp", addApp)
|
||||
} else return 0
|
||||
}))).then(() => {
|
||||
axios.post("/node/wechatapps/addOrUpdate", {
|
||||
type: "web",
|
||||
list: this.routes().map(({path: libPath, label, module: {name}, name: id}) => ({
|
||||
id, type: 'web', libPath, label, name
|
||||
}))
|
||||
}, {baseURL: "/ns"}).catch(() => 0)
|
||||
waiting.close()
|
||||
})
|
||||
const apps = require.context('../../', true, /\.(\/.+)\/App[A-Z][^\/]+\.vue$/, 'lazy')
|
||||
if (process.env.VUE_APP_DEV_MODE == 'fast') {
|
||||
waiting.init({innerHTML: '应用加载中..'})
|
||||
axios.post("/node/wechatapps/list", null, {
|
||||
params: {type: 'web', size: 999}, baseURL: "/ns"
|
||||
}).then(res => {
|
||||
if (res?.data) {
|
||||
return res.data.records.map(({label, name, libPath: path, id}) => {
|
||||
waiting.setContent(`加载${name}...`)
|
||||
const module = () => apps(`.${path}.vue`)
|
||||
const addApp = {label, name: id, path, component: appEntry, module}
|
||||
router.addRoute(addApp)
|
||||
store.commit("addApp", addApp)
|
||||
})
|
||||
}
|
||||
}).finally(() => waiting.close())
|
||||
} else {
|
||||
waiting.init({innerHTML: '应用加载中..'})
|
||||
Promise.all(apps.keys().map(path => apps(path).then(file => {
|
||||
if (file.default) {
|
||||
let {name, label} = file.default,
|
||||
addApp = {
|
||||
name: path.replace(/\.\/?(vue)?/g, '')?.split("/").join("_"), label: label || name,
|
||||
path: path.replace(/\.(\/.+\/App.+)\.vue$/, '$1'),
|
||||
component: appEntry,
|
||||
module: file.default
|
||||
}
|
||||
waiting.setContent(`加载${name}...`)
|
||||
router.addRoute(addApp)
|
||||
//命名规范入口文件必须以App开头
|
||||
return store.commit("addApp", addApp)
|
||||
} else return 0
|
||||
}))).then(() => {
|
||||
axios.post("/node/wechatapps/addOrUpdate", {
|
||||
type: "web",
|
||||
list: this.routes().map(({path: libPath, label, module: {name}, name: id}) => ({
|
||||
id, type: 'web', libPath, label, name
|
||||
}))
|
||||
}, {baseURL: "/ns"}).catch(() => 0)
|
||||
waiting.close()
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,8 +3,7 @@ import {Message} from 'element-ui'
|
||||
|
||||
let baseURLs = {
|
||||
production: "/",
|
||||
development: '/lan',
|
||||
oms: '/oms'
|
||||
development: '/saas'
|
||||
}
|
||||
instance.defaults.baseURL = baseURLs[process.env.NODE_ENV]
|
||||
instance.interceptors.request.use(config => {
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
"main": "lib/cw-webapps.common.js",
|
||||
"scripts": {
|
||||
"dev": "vue-cli-service serve",
|
||||
"fast": "npx cross-env VUE_APP_DEV_MODE=fast vue-cli-service serve",
|
||||
"lib": "vue-cli-service build --no-clean --target lib --dest lib packages/index.js&&npm unpublish --force&&npm publish",
|
||||
"lib:core": "vue-cli-service build --target lib --dest core/dist core/index.js --name dvcp-core&&npm unpublish dvcp-core --force&&npm publish core/",
|
||||
"lib:project": "node project/build.js",
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
# jessibuca-mobile-demo
|
||||
jessibuca mobile demo
|
||||
File diff suppressed because one or more lines are too long
Binary file not shown.
@@ -1,72 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>Document</title>
|
||||
<style>
|
||||
* {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
html,
|
||||
body {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
#container {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background-color: #000;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="container"></div>
|
||||
<script src="index.js"></script>
|
||||
|
||||
<script>
|
||||
var search = document.location.search
|
||||
|
||||
if (!search && search.split('url=').length < 2) {
|
||||
|
||||
} else {
|
||||
var url = search.split('url=')[1]
|
||||
var player = new window.Jessibuca({
|
||||
container: document.getElementById("container"),
|
||||
decoder: "./index.js",
|
||||
isResize: false,
|
||||
supportDblclickFullscreen: true,
|
||||
forceNoOffscreen: true,
|
||||
keepScreenOn: true,
|
||||
isNotMute: true,
|
||||
loadingText: '加载中...',
|
||||
operateBtns: {
|
||||
fullscreen: true,
|
||||
screenshot: true,
|
||||
play: true,
|
||||
audio: true,
|
||||
record: true
|
||||
}
|
||||
});
|
||||
|
||||
if (player.hasLoaded()) {
|
||||
player.play(url)
|
||||
} else {
|
||||
player.on('load', function () {
|
||||
player.play(url)
|
||||
})
|
||||
}
|
||||
|
||||
player.on('fullscreen', function (e) {
|
||||
window.parent.postMessage(e, '*')
|
||||
})
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
File diff suppressed because one or more lines are too long
@@ -10,17 +10,14 @@ module.exports = {
|
||||
filename: 'index.html'
|
||||
}
|
||||
},
|
||||
transpileDependencies: [/node_modules[/\\]dvcp-dv-ui/, /node_modules[/\\]dvcp-ui(.+)utils.js/],
|
||||
transpileDependencies: [/node_modules[/\\]dvcp-ui(.+)utils.js/],
|
||||
chainWebpack: (config) => {
|
||||
config.module
|
||||
.rule('js')
|
||||
.include.add(path.resolve(__dirname, 'packages'))
|
||||
.add(path.resolve(__dirname, 'subPackages'))
|
||||
.add(path.resolve(__dirname, 'core'))
|
||||
.add(path.resolve(__dirname, 'project'))
|
||||
.add(path.resolve(__dirname, 'oms'))
|
||||
.add(path.resolve(__dirname, 'examples'))
|
||||
.add(path.resolve(__dirname, 'node_modules/dvcp-dv-ui'))
|
||||
.add(path.resolve(__dirname, 'node_modules/dvcp-ui'))
|
||||
.end()
|
||||
.use('babel')
|
||||
|
||||
Reference in New Issue
Block a user