@modern-js/uni-builder 2.46.0 → 2.46.1

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.
@@ -53,18 +53,12 @@ const getServerOptions = (builderConfig) => {
53
53
  };
54
54
  };
55
55
  const getDevServerOptions = async ({ builderConfig, serverOptions, port }) => {
56
- var _builderConfig_dev, _builderConfig_dev1, _builderConfig_dev2, _builderConfig_tools;
57
- var _builderConfig_dev_hmr, _builderConfig_dev_hmr1;
56
+ var _builderConfig_dev, _builderConfig_tools;
58
57
  const defaultDevConfig = (0, import_shared.deepmerge)(
59
58
  {
60
- hot: (_builderConfig_dev_hmr = (_builderConfig_dev = builderConfig.dev) === null || _builderConfig_dev === void 0 ? void 0 : _builderConfig_dev.hmr) !== null && _builderConfig_dev_hmr !== void 0 ? _builderConfig_dev_hmr : true,
61
59
  watch: true,
62
- client: {
63
- port: port.toString()
64
- },
65
60
  port,
66
- liveReload: (_builderConfig_dev_hmr1 = (_builderConfig_dev1 = builderConfig.dev) === null || _builderConfig_dev1 === void 0 ? void 0 : _builderConfig_dev1.hmr) !== null && _builderConfig_dev_hmr1 !== void 0 ? _builderConfig_dev_hmr1 : true,
67
- https: (_builderConfig_dev2 = builderConfig.dev) === null || _builderConfig_dev2 === void 0 ? void 0 : _builderConfig_dev2.https
61
+ https: (_builderConfig_dev = builderConfig.dev) === null || _builderConfig_dev === void 0 ? void 0 : _builderConfig_dev.https
68
62
  },
69
63
  // merge devServerOptions from serverOptions
70
64
  serverOptions.dev || {}
@@ -127,8 +121,8 @@ async function startDevServer(rsbuild, options = {}, builderConfig) {
127
121
  port,
128
122
  routes: [
129
123
  {
130
- route: "/",
131
- name: "index"
124
+ pathname: "/",
125
+ entryName: "index"
132
126
  }
133
127
  ]
134
128
  });
@@ -191,19 +191,32 @@ async function parseCommonConfig(uniBuilderConfig, options) {
191
191
  if (dev.progressBar === void 0) {
192
192
  dev.progressBar = true;
193
193
  }
194
+ var _dev_hmr;
194
195
  const devServer = (0, import_shared.mergeChainedOptions)({
195
196
  defaults: {
196
197
  devMiddleware: {
197
198
  writeToDisk: (file) => !file.includes(".hot-update.")
199
+ },
200
+ hot: (_dev_hmr = dev === null || dev === void 0 ? void 0 : dev.hmr) !== null && _dev_hmr !== void 0 ? _dev_hmr : true,
201
+ liveReload: true,
202
+ client: {
203
+ path: "/webpack-hmr"
198
204
  }
199
205
  },
200
206
  options: tools.devServer,
201
207
  mergeFn: import_shared.deepmerge
202
208
  });
203
209
  dev.writeToDisk = (_devServer_devMiddleware = devServer.devMiddleware) === null || _devServer_devMiddleware === void 0 ? void 0 : _devServer_devMiddleware.writeToDisk;
204
- const server = (0, import_shared.isProd)() ? {} : {
210
+ dev.hmr = devServer.hot;
211
+ dev.client = devServer.client;
212
+ dev.liveReload = devServer.liveReload;
213
+ const server = (0, import_shared.isProd)() ? {
214
+ publicDir: false
215
+ } : {
216
+ publicDir: false,
205
217
  port: dev.port,
206
- host: dev.host
218
+ host: dev.host,
219
+ https: dev.https ? dev.https : void 0
207
220
  };
208
221
  delete tools.devServer;
209
222
  delete dev.https;
package/dist/types.d.ts CHANGED
@@ -51,6 +51,7 @@ export type UniBuilderExtraConfig = {
51
51
  devMiddleware?: {
52
52
  writeToDisk?: DevConfig['writeToDisk'];
53
53
  };
54
+ liveReload?: boolean;
54
55
  headers?: ServerConfig['headers'];
55
56
  historyApiFallback?: ServerConfig['historyApiFallback'];
56
57
  hot?: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@modern-js/uni-builder",
3
- "version": "2.46.0",
3
+ "version": "2.46.1",
4
4
  "description": "Unified builder for Modern.js",
5
5
  "repository": {
6
6
  "type": "git",
@@ -26,23 +26,23 @@
26
26
  "@babel/preset-react": "^7.22.15",
27
27
  "@babel/types": "^7.23.0",
28
28
  "@pmmmwh/react-refresh-webpack-plugin": "0.5.10",
29
- "@rsbuild/babel-preset": "0.3.3",
30
- "@rsbuild/core": "0.3.3",
31
- "@rsbuild/plugin-assets-retry": "0.3.3",
32
- "@rsbuild/plugin-babel": "0.3.3",
33
- "@rsbuild/plugin-check-syntax": "0.3.3",
34
- "@rsbuild/plugin-css-minimizer": "0.3.3",
35
- "@rsbuild/plugin-pug": "0.3.3",
36
- "@rsbuild/plugin-react": "0.3.3",
37
- "@rsbuild/plugin-rem": "0.3.3",
38
- "@rsbuild/plugin-source-build": "0.3.3",
39
- "@rsbuild/plugin-styled-components": "0.3.3",
40
- "@rsbuild/plugin-svgr": "0.3.3",
41
- "@rsbuild/plugin-type-check": "0.3.3",
42
- "@rsbuild/plugin-toml": "0.3.3",
43
- "@rsbuild/plugin-yaml": "0.3.3",
44
- "@rsbuild/shared": "0.3.3",
45
- "@rsbuild/webpack": "0.3.3",
29
+ "@rsbuild/babel-preset": "0.3.4",
30
+ "@rsbuild/core": "0.3.4",
31
+ "@rsbuild/plugin-assets-retry": "0.3.4",
32
+ "@rsbuild/plugin-babel": "0.3.4",
33
+ "@rsbuild/plugin-check-syntax": "0.3.4",
34
+ "@rsbuild/plugin-css-minimizer": "0.3.4",
35
+ "@rsbuild/plugin-pug": "0.3.4",
36
+ "@rsbuild/plugin-react": "0.3.4",
37
+ "@rsbuild/plugin-rem": "0.3.4",
38
+ "@rsbuild/plugin-source-build": "0.3.4",
39
+ "@rsbuild/plugin-styled-components": "0.3.4",
40
+ "@rsbuild/plugin-svgr": "0.3.4",
41
+ "@rsbuild/plugin-type-check": "0.3.4",
42
+ "@rsbuild/plugin-toml": "0.3.4",
43
+ "@rsbuild/plugin-yaml": "0.3.4",
44
+ "@rsbuild/shared": "0.3.4",
45
+ "@rsbuild/webpack": "0.3.4",
46
46
  "@swc/helpers": "0.5.3",
47
47
  "babel-loader": "9.1.3",
48
48
  "babel-plugin-import": "1.13.5",
@@ -64,19 +64,19 @@
64
64
  "webpack": "^5.89.0",
65
65
  "webpack-manifest-plugin": "5.0.0",
66
66
  "webpack-subresource-integrity": "5.1.0",
67
- "@modern-js/utils": "2.46.0",
68
- "@modern-js/server": "2.46.0",
69
- "@modern-js/prod-server": "2.46.0"
67
+ "@modern-js/utils": "2.46.1",
68
+ "@modern-js/server": "2.46.1",
69
+ "@modern-js/prod-server": "2.46.1"
70
70
  },
71
71
  "devDependencies": {
72
- "@rsbuild/plugin-swc": "0.3.3",
72
+ "@rsbuild/plugin-swc": "0.3.4",
73
73
  "@types/lodash": "^4.14.202",
74
74
  "react": "^18.2.0",
75
75
  "react-dom": "^18.2.0",
76
76
  "typescript": "^5.3.0",
77
- "@modern-js/builder-plugin-node-polyfill": "2.46.0",
78
- "@scripts/vitest-config": "2.46.0",
79
- "@scripts/build": "2.46.0"
77
+ "@modern-js/builder-plugin-node-polyfill": "2.46.1",
78
+ "@scripts/build": "2.46.1",
79
+ "@scripts/vitest-config": "2.46.1"
80
80
  },
81
81
  "publishConfig": {
82
82
  "access": "public",