mirror of
https://gitee.com/newgateway/vtj.git
synced 2026-05-07 01:10:03 +08:00
chore: 🚀 dev-uni调试工程
This commit is contained in:
@@ -5,8 +5,10 @@
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "cross-env ENV_TYPE=local vite",
|
||||
"dev:uni": "cross-env uni=true vite",
|
||||
"build": "pnpm run build:prod",
|
||||
"build:dev": "vue-tsc && cross-env ENV_TYPE=dev vite build",
|
||||
"build:uni": "vue-tsc && cross-env ENV_TYPE=dev uni=true vite build",
|
||||
"build:sit": "vue-tsc && cross-env ENV_TYPE=sit vite build",
|
||||
"build:uat": "vue-tsc && cross-env ENV_TYPE=uat vite build",
|
||||
"build:pre": "vue-tsc && cross-env ENV_TYPE=pre vite build",
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
<ElOption label="@vtj/core" value="core"></ElOption>
|
||||
<ElOption label="@vtj/designer" value="designer"></ElOption>
|
||||
<ElOption label="@vtj/materials" value="materials"></ElOption>
|
||||
<ElOption label="@vtj/uni" value="uni"></ElOption>
|
||||
<ElOption label="debug" value="debug"></ElOption>
|
||||
</ElSelect>
|
||||
</div>
|
||||
|
||||
@@ -2,12 +2,10 @@ import { createApp } from 'vue';
|
||||
import App from './App.vue';
|
||||
import router from './router';
|
||||
import { AdapterPlugin, IconsPlugin } from '@vtj/web';
|
||||
import { initUniFeatures } from '@vtj/uni/features';
|
||||
|
||||
// import ElementPlus from 'element-plus';
|
||||
import '@/style/index.scss';
|
||||
import './mock';
|
||||
initUniFeatures();
|
||||
|
||||
const app = createApp(App);
|
||||
app.use(router);
|
||||
app.use(IconsPlugin);
|
||||
|
||||
@@ -23,6 +23,4 @@
|
||||
app.mount(uniRef.value);
|
||||
});
|
||||
console.log('uniapp', app);
|
||||
|
||||
// console.log(injectHook);
|
||||
</script>
|
||||
8
dev/src/uni.ts
Normal file
8
dev/src/uni.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
import { createApp } from 'vue';
|
||||
import { initUniFeatures } from '@vtj/uni/features';
|
||||
import App from './pages/index.vue';
|
||||
|
||||
initUniFeatures();
|
||||
const app = createApp(App);
|
||||
|
||||
app.mount('#app');
|
||||
19
dev/uni.html
Normal file
19
dev/uni.html
Normal file
@@ -0,0 +1,19 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate"/>
|
||||
<meta http-equiv="Pragma" content="no-cache"/>
|
||||
<meta http-equiv="Expires" content="0"/>
|
||||
<title>VTJ dev</title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
<script type="module" src="/src/uni.ts"></script>
|
||||
<noscript>
|
||||
<p>JavaScript is disabled in your browser. Please enable JavaScript to experience the full functionality of this site.</p>
|
||||
</noscript>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -3,6 +3,7 @@ import { createDevTools } from '@vtj/local';
|
||||
import { resolve } from 'path';
|
||||
import proxy from './proxy.config';
|
||||
const isExtension = !!process.env.Extension;
|
||||
const isUni = !!process.env.uni;
|
||||
|
||||
function creator() {
|
||||
if (isExtension) {
|
||||
@@ -32,9 +33,15 @@ function creator() {
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
return {
|
||||
proxy,
|
||||
host: '0.0.0.0',
|
||||
pages: isUni
|
||||
? {
|
||||
main: 'uni.html'
|
||||
}
|
||||
: undefined,
|
||||
https: false,
|
||||
legacy: false,
|
||||
elementPlus: false,
|
||||
@@ -57,15 +64,11 @@ function creator() {
|
||||
packagesDir: '../packages'
|
||||
})
|
||||
],
|
||||
alias: {
|
||||
vue: '@dcloudio/uni-h5-vue'
|
||||
// vue: resolve(
|
||||
// '../node_modules/@dcloudio/uni-h5-vue/dist/vue.runtime.esm.js'
|
||||
// )
|
||||
}
|
||||
// vueDevTools: {
|
||||
// componentInspector: false
|
||||
// }
|
||||
alias: isUni
|
||||
? {
|
||||
vue: '@dcloudio/uni-h5-vue'
|
||||
}
|
||||
: undefined
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -23,7 +23,9 @@
|
||||
"scripts": {
|
||||
"setup": "pnpm install --unsafe-perm --registry=https://registry.npmmirror.com",
|
||||
"dev": "cd dev && npm run dev",
|
||||
"dev:uni": "cd dev && npm run dev:uni",
|
||||
"dev:build": "cd dev && npm run build",
|
||||
"dev:build-uni": "cd dev && npm run build:uni",
|
||||
"dev:preview": "cd dev && npm run preview",
|
||||
"clean": "lerna clean -y && node scripts/clean.mjs",
|
||||
"reset": "pnpm run clean && pnpm run setup",
|
||||
|
||||
@@ -66,7 +66,9 @@ const script = `
|
||||
valueEl.style.width = (current * 100 / total) + '%';
|
||||
if(!total || current === total) {
|
||||
setTimeout(function() {
|
||||
loading.parentNode.removeChild(loading);
|
||||
if(loading.parentNode){
|
||||
loading.parentNode.removeChild(loading);
|
||||
}
|
||||
loading = null;
|
||||
countEl = null;
|
||||
valueEl = null;
|
||||
|
||||
@@ -11,6 +11,7 @@ export default createViteConfig({
|
||||
'element-plus',
|
||||
'@element-plus/icons-vue',
|
||||
'@vtj/renderer',
|
||||
'@vtj/uni',
|
||||
'@vtj/core',
|
||||
'@vtj/utils',
|
||||
'@vtj/icons',
|
||||
@@ -18,13 +19,12 @@ export default createViteConfig({
|
||||
'element-plus/es/locale/lang/zh-cn',
|
||||
'html2canvas',
|
||||
'mockjs',
|
||||
'monaco-editor',
|
||||
'monaco-editor'
|
||||
// 'monaco-editor/esm/vs/editor/editor.worker?worker',
|
||||
// 'monaco-editor/esm/vs/language/json/json.worker?worker',
|
||||
// 'monaco-editor/esm/vs/language/css/css.worker?worker',
|
||||
// 'monaco-editor/esm/vs/language/html/html.worker?worker',
|
||||
// 'monaco-editor/esm/vs/language/typescript/ts.worker?worker',
|
||||
'mockjs'
|
||||
// 'monaco-editor/esm/vs/language/typescript/ts.worker?worker'
|
||||
],
|
||||
formats: ['es']
|
||||
});
|
||||
|
||||
@@ -14,7 +14,8 @@
|
||||
"@vtj/designer": "workspace:~",
|
||||
"@vtj/local": "workspace:~",
|
||||
"@vtj/materials": "workspace:~",
|
||||
"@vtj/renderer": "workspace:~"
|
||||
"@vtj/renderer": "workspace:~",
|
||||
"@vtj/uni": "workspace:~"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@vtj/charts": "workspace:~",
|
||||
|
||||
Reference in New Issue
Block a user