@quicktvui/web-cli 1.0.0-beta.31 → 1.0.0-beta.33

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.
@@ -66,9 +66,8 @@ import(__QUICKTVUI_MAIN_ENTRY__)
66
66
 
67
67
  // HMR 支持
68
68
  if (module.hot) {
69
- module.hot.accept()
70
- module.hot.accept(__QUICKTVUI_MAIN_ENTRY__, () => {
71
- console.log('[Web Renderer] Main module updated, reloading...')
69
+ module.hot.accept(() => {
70
+ console.log('[Web Renderer] HMR update received, reloading...')
72
71
  window.location.reload()
73
72
  })
74
73
  }
@@ -106,7 +106,14 @@ const resolveLoader = (loaderName) => require.resolve(loaderName, { paths: [cliD
106
106
 
107
107
  // 入口文件:只加载 entry-package.js,主入口通过动态 import 加载
108
108
  const entryPackageFile = path.resolve(__dirname, 'entry-package.js')
109
- const entryFiles = ['regenerator-runtime/runtime', entryPackageFile]
109
+ // 手动注入 webpack-dev-server 客户端(全局安装时需要)
110
+ const webpackDevServerPath = require.resolve('webpack-dev-server/client', { paths: [cliDir] })
111
+ const entryFiles = [
112
+ `${webpackDevServerPath}?http://localhost:${port}`,
113
+ 'webpack/hot/dev-server',
114
+ 'regenerator-runtime/runtime',
115
+ entryPackageFile,
116
+ ]
110
117
 
111
118
  module.exports = {
112
119
  mode: 'development',
@@ -148,8 +155,7 @@ module.exports = {
148
155
  },
149
156
 
150
157
  watchOptions: {
151
- aggregateTimeout: 1500,
152
- poll: 1000,
158
+ aggregateTimeout: 300,
153
159
  ignored: /node_modules/,
154
160
  },
155
161
 
@@ -163,6 +169,7 @@ module.exports = {
163
169
  output: {
164
170
  filename: 'index.bundle.js',
165
171
  path: path.resolve(projectRoot, './dist/web/'),
172
+ publicPath: '/',
166
173
  strictModuleExceptionHandling: true,
167
174
  globalObject: '(0, eval)("this")',
168
175
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quicktvui/web-cli",
3
- "version": "1.0.0-beta.31",
3
+ "version": "1.0.0-beta.33",
4
4
  "description": "CLI tool for QuickTVUI web development - zero configuration",
5
5
  "author": "QuickTVUI Team",
6
6
  "license": "Apache-2.0",