@quicktvui/web-cli 1.0.0-beta.21 → 1.0.0-beta.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/webpack.config.js +9 -10
- package/package.json +2 -2
- package/templates/web-renderer.html +11 -0
package/lib/webpack.config.js
CHANGED
|
@@ -100,8 +100,9 @@ function detectCSSLoader() {
|
|
|
100
100
|
|
|
101
101
|
const cssLoader = detectCSSLoader()
|
|
102
102
|
|
|
103
|
-
//
|
|
103
|
+
// 入口文件:只加载 entry-package.js,主入口通过动态 import 加载
|
|
104
104
|
const entryPackageFile = path.resolve(__dirname, 'entry-package.js')
|
|
105
|
+
const entryFiles = ['regenerator-runtime/runtime', entryPackageFile]
|
|
105
106
|
|
|
106
107
|
module.exports = {
|
|
107
108
|
mode: 'development',
|
|
@@ -143,15 +144,16 @@ module.exports = {
|
|
|
143
144
|
},
|
|
144
145
|
|
|
145
146
|
watchOptions: {
|
|
146
|
-
aggregateTimeout:
|
|
147
|
+
aggregateTimeout: 1500,
|
|
148
|
+
poll: 1000,
|
|
147
149
|
ignored: /node_modules/,
|
|
148
150
|
},
|
|
149
151
|
|
|
150
|
-
devtool: '
|
|
152
|
+
devtool: 'source-map',
|
|
151
153
|
|
|
152
|
-
//
|
|
154
|
+
// 多入口配置:先加载初始化代码,再加载主入口
|
|
153
155
|
entry: {
|
|
154
|
-
index:
|
|
156
|
+
index: entryFiles,
|
|
155
157
|
},
|
|
156
158
|
|
|
157
159
|
output: {
|
|
@@ -192,10 +194,7 @@ module.exports = {
|
|
|
192
194
|
use: [
|
|
193
195
|
{
|
|
194
196
|
loader: 'vue-loader',
|
|
195
|
-
options: {
|
|
196
|
-
compilerOptions: { whitespace: 'condense' },
|
|
197
|
-
hotReload: true,
|
|
198
|
-
},
|
|
197
|
+
options: { compilerOptions: { whitespace: 'condense' } },
|
|
199
198
|
},
|
|
200
199
|
'scope-loader',
|
|
201
200
|
],
|
|
@@ -275,6 +274,6 @@ module.exports = {
|
|
|
275
274
|
|
|
276
275
|
performance: { hints: false },
|
|
277
276
|
|
|
278
|
-
//
|
|
277
|
+
// 忽略 entry-local.js 中动态 require 的警告(这是预期行为)
|
|
279
278
|
ignoreWarnings: [/Critical dependency: the request of a dependency is an expression/],
|
|
280
279
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quicktvui/web-cli",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.23",
|
|
4
4
|
"description": "CLI tool for QuickTVUI web development - zero configuration",
|
|
5
5
|
"author": "QuickTVUI Team",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"minimist": "^1.2.8",
|
|
25
25
|
"shelljs": "^0.10.0",
|
|
26
26
|
"signale": "^1.4.0",
|
|
27
|
-
"@quicktvui/web-renderer": "^1.0.
|
|
27
|
+
"@quicktvui/web-renderer": "^1.0.7",
|
|
28
28
|
"scope-loader": "^1.0.3",
|
|
29
29
|
"webpack": "^5.89.0",
|
|
30
30
|
"webpack-cli": "^5.1.0",
|
|
@@ -50,6 +50,7 @@
|
|
|
50
50
|
height: 1080px !important;
|
|
51
51
|
transform-origin: top left;
|
|
52
52
|
background-color: #26292F;
|
|
53
|
+
visibility: hidden;
|
|
53
54
|
}
|
|
54
55
|
/* 返回按钮样式 */
|
|
55
56
|
#web-back-btn {
|
|
@@ -131,6 +132,9 @@
|
|
|
131
132
|
var offsetY = (_originalInnerHeight - TV_HEIGHT * scale) / 2;
|
|
132
133
|
app.style.marginLeft = offsetX + 'px';
|
|
133
134
|
app.style.marginTop = offsetY + 'px';
|
|
135
|
+
|
|
136
|
+
// Show the app after positioning
|
|
137
|
+
app.style.visibility = 'visible';
|
|
134
138
|
|
|
135
139
|
// 更新返回按钮位置,相对于 #app 左上角
|
|
136
140
|
var btn = document.getElementById('web-back-btn');
|
|
@@ -144,6 +148,13 @@
|
|
|
144
148
|
}
|
|
145
149
|
}
|
|
146
150
|
}
|
|
151
|
+
|
|
152
|
+
// Execute immediately when DOM is ready (before load event)
|
|
153
|
+
if (document.readyState === 'loading') {
|
|
154
|
+
document.addEventListener('DOMContentLoaded', scaleApp);
|
|
155
|
+
} else {
|
|
156
|
+
scaleApp();
|
|
157
|
+
}
|
|
147
158
|
window.addEventListener('load', scaleApp);
|
|
148
159
|
window.addEventListener('resize', scaleApp);
|
|
149
160
|
</script>
|