@tuya-sat/micro-script 3.0.0-beta.22 → 3.0.0-beta.24

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.
@@ -20,7 +20,6 @@ const copy_webpack_plugin_1 = __importDefault(require("copy-webpack-plugin"));
20
20
  const mini_css_extract_plugin_1 = __importDefault(require("mini-css-extract-plugin"));
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
- const terser_webpack_plugin_1 = __importDefault(require("terser-webpack-plugin"));
24
23
  const micro_dev_loader_1 = require("@tuya-sat/micro-dev-loader");
25
24
  const path_1 = __importDefault(require("path"));
26
25
  const index_1 = require("@tuya-sat/micro-dev-loader/dist/less/utils/index");
@@ -40,7 +39,6 @@ const validateMicroTheme = () => {
40
39
  exports.validateMicroTheme = validateMicroTheme;
41
40
  function getCommonConfig({ isDev, isBuild, }) {
42
41
  const { name: packageName } = require(paths_1.default.appPkg);
43
- const { debuggerConfig: { isMainApp }, } = require(paths_1.default.microConfig);
44
42
  const devMicroTheme = (0, exports.validateMicroTheme)();
45
43
  const enableThemeCompile = isDev
46
44
  ? !!devMicroTheme
@@ -69,14 +67,14 @@ function getCommonConfig({ isDev, isBuild, }) {
69
67
  ].filter(Boolean);
70
68
  return loaders;
71
69
  };
72
- const { multiApps } = require(paths_1.default.microConfig);
70
+ const { multiApps, debuggerConfig: { isMainApp } } = require(paths_1.default.microConfig);
73
71
  const multiAppsWebpackConfig = {
74
72
  plugins: [],
75
73
  entry: {},
76
74
  };
77
75
  function getWebpackConfig(htmlplugins) {
78
76
  const baseConfig = {
79
- mode: isMainApp ? 'development' : isBuild ? 'production' : 'development',
77
+ mode: isBuild ? 'production' : 'development',
80
78
  output: {
81
79
  filename: isBuild
82
80
  ? 'static/js/[name].[contenthash:8].js'
@@ -172,7 +170,7 @@ function getCommonConfig({ isDev, isBuild, }) {
172
170
  } }),
173
171
  },
174
172
  minimize: isBuild,
175
- minimizer: ['...', new terser_webpack_plugin_1.default(), new css_minimizer_webpack_plugin_1.default()],
173
+ minimizer: ['...', new css_minimizer_webpack_plugin_1.default()],
176
174
  },
177
175
  plugins: [
178
176
  new html_webpack_plugin_1.default({
@@ -187,7 +185,13 @@ function getCommonConfig({ isDev, isBuild, }) {
187
185
  filter: (resourcePath) => __awaiter(this, void 0, void 0, function* () { return resourcePath !== paths_1.default.spaHtml; }),
188
186
  noErrorOnMissing: true,
189
187
  },
190
- ],
188
+ isMainApp && {
189
+ from: "node_modules/@tuya-sat/sdf-main-sdk/dist/**/*.png",
190
+ to() {
191
+ return "static/img/[name][ext]";
192
+ },
193
+ },
194
+ ].filter((value) => Boolean(value)),
191
195
  }),
192
196
  isBuild &&
193
197
  new mini_css_extract_plugin_1.default({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tuya-sat/micro-script",
3
- "version": "3.0.0-beta.22",
3
+ "version": "3.0.0-beta.24",
4
4
  "bin": "./dist/bin/cli.js",
5
5
  "type": "commonjs",
6
6
  "license": "MIT",
@@ -20,9 +20,9 @@
20
20
  "@babel/preset-react": "7.16.7",
21
21
  "@babel/preset-typescript": "7.16.7",
22
22
  "@pmmmwh/react-refresh-webpack-plugin": "0.5.4",
23
- "@tuya-sat/micro-dev-loader": "3.0.0-beta.22",
24
- "@tuya-sat/micro-dev-proxy": "3.0.0-beta.22",
25
- "@tuya-sat/micro-utils": "3.0.0-beta.22",
23
+ "@tuya-sat/micro-dev-loader": "3.0.0-beta.24",
24
+ "@tuya-sat/micro-dev-proxy": "3.0.0-beta.24",
25
+ "@tuya-sat/micro-utils": "3.0.0-beta.24",
26
26
  "@types/kill-port": "^2.0.0",
27
27
  "babel-loader": "8.2.4",
28
28
  "babel-plugin-import": "1.13.3",