@tuya-sat/micro-script 3.0.11 → 3.0.13

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.
@@ -21,6 +21,7 @@ const mini_css_extract_plugin_1 = __importDefault(require("mini-css-extract-plug
21
21
  const html_webpack_plugin_1 = __importDefault(require("html-webpack-plugin"));
22
22
  const css_minimizer_webpack_plugin_1 = __importDefault(require("css-minimizer-webpack-plugin"));
23
23
  const webpack_manifest_plugin_1 = require("webpack-manifest-plugin");
24
+ const webpack_stats_plugin_1 = require("webpack-stats-plugin");
24
25
  const micro_dev_loader_1 = require("@tuya-sat/micro-dev-loader");
25
26
  const path_1 = __importDefault(require("path"));
26
27
  const index_1 = require("@tuya-sat/micro-dev-loader/dist/less/utils/index");
@@ -174,11 +175,14 @@ function getCommonConfig({ isDev, isBuild, }) {
174
175
  minimizer: ['...', new css_minimizer_webpack_plugin_1.default()],
175
176
  },
176
177
  plugins: [
177
- new html_webpack_plugin_1.default({
178
- inject: true,
179
- template: paths_1.default.spaHtml,
180
- }),
181
- ...htmlplugins,
178
+ ...[
179
+ (htmlplugins === null || htmlplugins === void 0 ? void 0 : htmlplugins.length) > 0
180
+ ? htmlplugins
181
+ : new html_webpack_plugin_1.default({
182
+ inject: true,
183
+ template: paths_1.default.spaHtml,
184
+ }),
185
+ ],
182
186
  new copy_webpack_plugin_1.default({
183
187
  patterns: [
184
188
  {
@@ -201,6 +205,7 @@ function getCommonConfig({ isDev, isBuild, }) {
201
205
  }),
202
206
  isBuild && enableThemeCompile && new micro_dev_loader_1.ThemePlugin(),
203
207
  isBuild && new webpack_manifest_plugin_1.WebpackManifestPlugin({}),
208
+ isBuild && new webpack_stats_plugin_1.StatsWriterPlugin({}),
204
209
  ].filter((value) => Boolean(value)),
205
210
  };
206
211
  return baseConfig;
@@ -218,10 +223,12 @@ function getCommonConfig({ isDev, isBuild, }) {
218
223
  }));
219
224
  });
220
225
  console.log('multiAppsWebpackConfig', multiAppsWebpackConfig);
221
- return (0, webpack_merge_1.merge)(getWebpackConfig(multiAppsWebpackConfig.plugins), {
226
+ const appsResult = (0, webpack_merge_1.merge)(getWebpackConfig(multiAppsWebpackConfig.plugins), {
222
227
  entry: multiAppsWebpackConfig.entry,
223
228
  });
229
+ return appsResult;
224
230
  }
225
- return getWebpackConfig([]);
231
+ const result = getWebpackConfig([]);
232
+ return result;
226
233
  }
227
234
  exports.default = getCommonConfig;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tuya-sat/micro-script",
3
- "version": "3.0.11",
3
+ "version": "3.0.13",
4
4
  "bin": "./dist/bin/cli.js",
5
5
  "type": "commonjs",
6
6
  "license": "MIT",
@@ -23,9 +23,9 @@
23
23
  "@babel/preset-typescript": "7.16.7",
24
24
  "@babel/traverse": "^7.20.13",
25
25
  "@pmmmwh/react-refresh-webpack-plugin": "0.5.4",
26
- "@tuya-sat/micro-dev-loader": "3.0.11",
27
- "@tuya-sat/micro-dev-proxy": "3.0.11",
28
- "@tuya-sat/micro-utils": "3.0.11",
26
+ "@tuya-sat/micro-dev-loader": "3.0.13",
27
+ "@tuya-sat/micro-dev-proxy": "3.0.13",
28
+ "@tuya-sat/micro-utils": "3.0.13",
29
29
  "@types/kill-port": "^2.0.0",
30
30
  "babel-loader": "8.2.4",
31
31
  "babel-plugin-import": "1.13.3",
@@ -74,10 +74,12 @@
74
74
  "@types/express": "4.17.13",
75
75
  "@types/jest": "27.4.1",
76
76
  "@types/uuid": "8.3.4",
77
+ "@types/webpack-stats-plugin": "^0.3.2",
77
78
  "jest": "27.5.1",
78
79
  "terser-webpack-plugin": "^5.3.6",
79
80
  "ts-jest": "27.1.3",
80
- "typescript": "4.6.2"
81
+ "typescript": "4.6.2",
82
+ "webpack-stats-plugin": "^1.1.1"
81
83
  },
82
84
  "keywords": [
83
85
  "saturn-project",