@tuya-sat/micro-script 3.0.0-beta.21 → 3.0.0-beta.23

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
@@ -76,7 +74,7 @@ function getCommonConfig({ isDev, isBuild, }) {
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({
@@ -1,4 +1,4 @@
1
- import { FrameworkFunction } from "./index";
1
+ import { FrameworkFunction } from './index';
2
2
  declare const reactTsConfig: FrameworkFunction;
3
3
  declare const reactJsConfig: FrameworkFunction;
4
4
  export { reactTsConfig, reactJsConfig };
@@ -17,26 +17,26 @@ const reactConfig = ({ isDev, isBuild, currentFramework, isTs, }) => {
17
17
  include: paths_1.default.appSrc,
18
18
  use: [
19
19
  {
20
- loader: require.resolve("babel-loader"),
20
+ loader: require.resolve('babel-loader'),
21
21
  options: {
22
22
  presets: [
23
23
  [
24
- require.resolve("@babel/preset-env"),
24
+ require.resolve('@babel/preset-env'),
25
25
  {
26
- useBuiltIns: "entry",
26
+ useBuiltIns: 'entry',
27
27
  corejs: 3,
28
28
  },
29
29
  ],
30
30
  [
31
- require.resolve("@babel/preset-react"),
31
+ require.resolve('@babel/preset-react'),
32
32
  {
33
- runtime: "automatic",
33
+ runtime: 'automatic',
34
34
  },
35
35
  ],
36
- isTs && require.resolve("@babel/preset-typescript"),
36
+ isTs && require.resolve('@babel/preset-typescript'),
37
37
  ].filter(Boolean),
38
38
  plugins: [
39
- isDev && require.resolve("react-refresh/babel"),
39
+ isDev && require.resolve('react-refresh/babel'),
40
40
  ].filter(Boolean),
41
41
  },
42
42
  },
@@ -48,7 +48,7 @@ const reactConfig = ({ isDev, isBuild, currentFramework, isTs, }) => {
48
48
  exclude: paths_1.default.appSrc,
49
49
  use: [
50
50
  {
51
- loader: require.resolve("babel-loader"),
51
+ loader: require.resolve('babel-loader'),
52
52
  },
53
53
  ],
54
54
  },
@@ -64,18 +64,18 @@ const reactConfig = ({ isDev, isBuild, currentFramework, isTs, }) => {
64
64
  semantic: true,
65
65
  syntactic: true,
66
66
  },
67
- mode: "write-references",
67
+ mode: 'write-references',
68
68
  },
69
69
  }),
70
70
  ].filter((value) => Boolean(value)),
71
71
  };
72
72
  };
73
73
  const reactTsConfig = ({ isDev, isBuild, currentFramework, }) => (Object.assign({ entry: paths_1.default.ReactTsEntryFile, resolve: {
74
- extensions: [".tsx", ".ts", ".js"],
74
+ extensions: ['.tsx', '.ts', '.js'],
75
75
  plugins: [new tsconfig_paths_webpack_plugin_1.default()],
76
76
  } }, reactConfig({ isDev, isBuild, currentFramework, isTs: true })));
77
77
  exports.reactTsConfig = reactTsConfig;
78
78
  const reactJsConfig = ({ isDev, isBuild, currentFramework, }) => (Object.assign({ entry: paths_1.default.ReactJsEntryFile, resolve: {
79
- extensions: [".jsx", ".js"],
79
+ extensions: ['.jsx', '.js'],
80
80
  } }, reactConfig({ isDev, isBuild, currentFramework, isTs: false })));
81
81
  exports.reactJsConfig = reactJsConfig;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tuya-sat/micro-script",
3
- "version": "3.0.0-beta.21",
3
+ "version": "3.0.0-beta.23",
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.21",
24
- "@tuya-sat/micro-dev-proxy": "3.0.0-beta.21",
25
- "@tuya-sat/micro-utils": "3.0.0-beta.21",
23
+ "@tuya-sat/micro-dev-loader": "3.0.0-beta.23",
24
+ "@tuya-sat/micro-dev-proxy": "3.0.0-beta.23",
25
+ "@tuya-sat/micro-utils": "3.0.0-beta.23",
26
26
  "@types/kill-port": "^2.0.0",
27
27
  "babel-loader": "8.2.4",
28
28
  "babel-plugin-import": "1.13.3",
@@ -54,13 +54,14 @@
54
54
  "sass-loader": "12.6.0",
55
55
  "style-loader": "3.3.1",
56
56
  "svg-url-loader": "7.1.1",
57
- "tsconfig-paths-webpack-plugin": "3.5.2",
57
+ "tsconfig-paths-webpack-plugin": "^4.0.0",
58
58
  "uid": "^2.0.1",
59
59
  "url-loader": "4.1.1",
60
60
  "uuid": "8.3.2",
61
61
  "vue-loader": "17.0.0",
62
- "webpack": "5.70.0",
63
- "webpack-dev-server": "4.7.4",
62
+ "webpack": "5.75.0",
63
+ "webpack-cli": "5.0.1",
64
+ "webpack-dev-server": "4.11.1",
64
65
  "webpack-merge": "5.8.0"
65
66
  },
66
67
  "devDependencies": {