@tuya-sat/micro-script 3.0.16 → 3.0.17-beta.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.
@@ -209,7 +209,7 @@ function getCommonConfig({ isDev, isBuild, }) {
209
209
  }
210
210
  if (multiApps && multiApps.length > 0) {
211
211
  multiApps.forEach((app) => {
212
- multiAppsWebpackConfig.entry[app.name] = `${path_1.default.join(process.cwd(), app.dir)}/index.tsx`;
212
+ multiAppsWebpackConfig.entry[app.name] = `${path_1.default.join(process.cwd(), app.dir)}/${(0, utils_1.isMonorepo)() ? 'src/' : ''}index.tsx`;
213
213
  multiAppsWebpackConfig.plugins.push(new html_webpack_plugin_1.default({
214
214
  inject: true,
215
215
  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.1",
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.1",
27
+ "@tuya-sat/micro-dev-proxy": "3.0.17-beta.1",
28
+ "@tuya-sat/micro-utils": "3.0.17-beta.1",
29
29
  "@types/kill-port": "^2.0.0",
30
30
  "babel-loader": "8.2.4",
31
31
  "babel-plugin-import": "1.13.3",