@tuya-sat/micro-script 3.0.16 → 3.0.17-beta.2

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.
@@ -202,14 +202,20 @@ function getCommonConfig({ isDev, isBuild, }) {
202
202
  }),
203
203
  isBuild && enableThemeCompile && new micro_dev_loader_1.ThemePlugin(),
204
204
  isBuild && new webpack_manifest_plugin_1.WebpackManifestPlugin({}),
205
- isBuild && new webpack_stats_plugin_1.StatsWriterPlugin({}),
205
+ isBuild &&
206
+ new webpack_stats_plugin_1.StatsWriterPlugin({
207
+ stats: {
208
+ all: false,
209
+ entryPoints: true,
210
+ },
211
+ }),
206
212
  ].filter((value) => Boolean(value)),
207
213
  };
208
214
  return baseConfig;
209
215
  }
210
216
  if (multiApps && multiApps.length > 0) {
211
217
  multiApps.forEach((app) => {
212
- multiAppsWebpackConfig.entry[app.name] = `${path_1.default.join(process.cwd(), app.dir)}/index.tsx`;
218
+ multiAppsWebpackConfig.entry[app.name] = `${path_1.default.join(process.cwd(), app.dir)}/${(0, utils_1.isMonorepo)() ? 'src/' : ''}index.tsx`;
213
219
  multiAppsWebpackConfig.plugins.push(new html_webpack_plugin_1.default({
214
220
  inject: true,
215
221
  filename: app.htmlContentHash
@@ -14,7 +14,7 @@ const reactConfig = ({ isDev, isBuild, currentFramework, isTs, }) => {
14
14
  rules: [
15
15
  {
16
16
  test: /\.(js|mjs|jsx|ts|tsx)$/,
17
- include: paths_1.default.appSrc,
17
+ exclude: /node_modules/,
18
18
  use: [
19
19
  {
20
20
  loader: require.resolve('babel-loader'),
@@ -1 +1,2 @@
1
1
  export declare const getAnnotations: () => any;
2
+ export declare const isMonorepo: () => boolean;
@@ -26,7 +26,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
26
26
  return (mod && mod.__esModule) ? mod : { "default": mod };
27
27
  };
28
28
  Object.defineProperty(exports, "__esModule", { value: true });
29
- exports.getAnnotations = void 0;
29
+ exports.isMonorepo = exports.getAnnotations = void 0;
30
30
  const micro_utils_1 = require("@tuya-sat/micro-utils");
31
31
  const path = __importStar(require("path"));
32
32
  const paths_1 = __importDefault(require("../config/paths"));
@@ -41,3 +41,11 @@ const getAnnotations = () => {
41
41
  }
42
42
  };
43
43
  exports.getAnnotations = getAnnotations;
44
+ const isMonorepo = () => {
45
+ if (fs_extra_1.default.existsSync(path.join(process.cwd(), 'apps')) &&
46
+ fs_extra_1.default.existsSync(path.join(process.cwd(), 'packages'))) {
47
+ return true;
48
+ }
49
+ return false;
50
+ };
51
+ exports.isMonorepo = isMonorepo;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tuya-sat/micro-script",
3
- "version": "3.0.16",
3
+ "version": "3.0.17-beta.2",
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.16",
27
- "@tuya-sat/micro-dev-proxy": "3.0.16",
28
- "@tuya-sat/micro-utils": "3.0.16",
26
+ "@tuya-sat/micro-dev-loader": "3.0.17-beta.2",
27
+ "@tuya-sat/micro-dev-proxy": "3.0.17-beta.2",
28
+ "@tuya-sat/micro-utils": "3.0.17-beta.2",
29
29
  "@types/kill-port": "^2.0.0",
30
30
  "babel-loader": "8.2.4",
31
31
  "babel-plugin-import": "1.13.3",