@tuya-sat/micro-script 0.0.1-beta.1 → 0.0.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.
package/README.md CHANGED
@@ -1,5 +1,4 @@
1
1
  <div id="top"></div>
2
- <!-- PROJECT LOGO -->
3
2
  <br />
4
3
  <div align="center">
5
4
  <a href="https://github.com/othneildrew/Best-README-Template">
@@ -10,6 +9,12 @@
10
9
 
11
10
  <p align="center">
12
11
  本地开发和打包脚本
12
+ <br/>
13
+ <a href="https://github.com/tuya-sat/discuss">土星项目</a>
14
+ ·
15
+ <a href="https://github.com/tuya-sat/discuss/issues">报告问题</a>
16
+ ·
17
+ <a href="https://github.com/tuya-sat/discuss/issues">提交需求</a>
13
18
  </p>
14
19
  </div>
15
20
 
@@ -54,3 +59,7 @@ micro-script
54
59
  MIT
55
60
 
56
61
 
62
+ ## 联系我们
63
+
64
+ 欢迎在 [https://github.com/tuya-sat/discuss/issues](https://github.com/tuya-sat/discuss/issues) 向我们提交反馈
65
+
@@ -57,6 +57,7 @@ export default function getCommonConfig({ isDev, isBuild }: {
57
57
  };
58
58
  };
59
59
  };
60
+ minimizer: (string | import("css-minimizer-webpack-plugin/types").default<import("css-minimizer-webpack-plugin/types").CssNanoOptionsExtended>)[];
60
61
  };
61
62
  plugins: any[];
62
63
  };
@@ -15,7 +15,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
15
15
  const copy_webpack_plugin_1 = __importDefault(require("copy-webpack-plugin"));
16
16
  const html_webpack_plugin_1 = __importDefault(require("html-webpack-plugin"));
17
17
  const mini_css_extract_plugin_1 = __importDefault(require("mini-css-extract-plugin"));
18
- const micro_dev_loader_1 = require("@tuya-sat/micro-dev-loader");
18
+ const css_minimizer_webpack_plugin_1 = __importDefault(require("css-minimizer-webpack-plugin"));
19
19
  const paths_1 = __importDefault(require("./paths"));
20
20
  function getCommonConfig({ isDev, isBuild }) {
21
21
  const { name: packageName } = require(paths_1.default.appPkg);
@@ -121,6 +121,7 @@ function getCommonConfig({ isDev, isBuild }) {
121
121
  },
122
122
  },
123
123
  },
124
+ minimizer: ["...", new css_minimizer_webpack_plugin_1.default()],
124
125
  },
125
126
  plugins: [
126
127
  new html_webpack_plugin_1.default({
@@ -140,7 +141,6 @@ function getCommonConfig({ isDev, isBuild }) {
140
141
  filename: "static/css/[name].[contenthash:8].css",
141
142
  chunkFilename: "static/css/[name].[contenthash:8].chunk.css",
142
143
  }),
143
- isDev && new micro_dev_loader_1.LayoutMockPlugin(),
144
144
  ].filter(Boolean),
145
145
  };
146
146
  }
@@ -22,6 +22,14 @@ declare const reactTsConfig: ({ isDev, isBuild, currentFramework }: {
22
22
  plugins: string[];
23
23
  };
24
24
  }[];
25
+ exclude?: undefined;
26
+ } | {
27
+ test: RegExp;
28
+ exclude: string;
29
+ use: {
30
+ loader: string;
31
+ }[];
32
+ include?: undefined;
25
33
  } | {
26
34
  test: string;
27
35
  include: string;
@@ -31,6 +39,7 @@ declare const reactTsConfig: ({ isDev, isBuild, currentFramework }: {
31
39
  microFramework: any;
32
40
  };
33
41
  }[];
42
+ exclude?: undefined;
34
43
  })[];
35
44
  };
36
45
  plugins: (ReactRefreshWebpackPlugin | ForkTsCheckerWebpackPlugin)[];
@@ -61,6 +70,14 @@ declare const reactJsConfig: ({ isDev, isBuild, currentFramework }: {
61
70
  plugins: string[];
62
71
  };
63
72
  }[];
73
+ exclude?: undefined;
74
+ } | {
75
+ test: RegExp;
76
+ exclude: string;
77
+ use: {
78
+ loader: string;
79
+ }[];
80
+ include?: undefined;
64
81
  } | {
65
82
  test: string;
66
83
  include: string;
@@ -70,6 +87,7 @@ declare const reactJsConfig: ({ isDev, isBuild, currentFramework }: {
70
87
  microFramework: any;
71
88
  };
72
89
  }[];
90
+ exclude?: undefined;
73
91
  })[];
74
92
  };
75
93
  plugins: (ReactRefreshWebpackPlugin | ForkTsCheckerWebpackPlugin)[];
@@ -40,6 +40,16 @@ const reactConfig = ({ isDev, isBuild, currentFramework, isTs }) => {
40
40
  },
41
41
  ],
42
42
  },
43
+ //处理@tuya-sat/components内的antd组件引用
44
+ {
45
+ test: /node_modules\/@tuya-sat\/components\/(.*?).js$/,
46
+ exclude: paths_1.default.appSrc,
47
+ use: [
48
+ {
49
+ loader: "babel-loader",
50
+ },
51
+ ],
52
+ },
43
53
  isDev && {
44
54
  test: isTs ? paths_1.default.ReactTsEntryFile : paths_1.default.ReactJsEntryFile,
45
55
  include: paths_1.default.appSrc,
@@ -28,6 +28,7 @@ const config = Object.assign(Object.assign({}, (0, webpack_config_1.default)()),
28
28
  level: "warn",
29
29
  }, stats: "errors-warnings" });
30
30
  const compiler = (0, webpack_1.default)(config);
31
+ new micro_dev_loader_1.LayoutMockPlugin().apply(compiler);
31
32
  (() => __awaiter(void 0, void 0, void 0, function* () {
32
33
  let defaultPort = 9000;
33
34
  //检测端口占用情况
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tuya-sat/micro-script",
3
- "version": "0.0.1-beta.1",
3
+ "version": "0.0.2",
4
4
  "bin": "./dist/bin/cli.js",
5
5
  "type": "commonjs",
6
6
  "license": "MIT",
@@ -15,12 +15,13 @@
15
15
  "@babel/preset-react": "^7.14.5",
16
16
  "@babel/preset-typescript": "^7.15.0",
17
17
  "@pmmmwh/react-refresh-webpack-plugin": "^0.5.1",
18
- "@tuya-sat/micro-dev-loader": "0.0.1-beta.1",
19
- "@tuya-sat/micro-dev-proxy": "0.0.1-beta.1",
18
+ "@tuya-sat/micro-dev-loader": "0.0.2",
19
+ "@tuya-sat/micro-dev-proxy": "0.0.2",
20
20
  "babel-loader": "^8.2.2",
21
21
  "babel-plugin-import": "^1.13.3",
22
22
  "copy-webpack-plugin": "^9.0.1",
23
23
  "css-loader": "^6.4.0",
24
+ "css-minimizer-webpack-plugin": "^3.2.0",
24
25
  "fork-ts-checker-webpack-plugin": "^6.4.0",
25
26
  "html-webpack-plugin": "^5.3.2",
26
27
  "less": "^4.1.2",
@@ -42,12 +43,19 @@
42
43
  "url-loader": "^4.1.1",
43
44
  "vue-loader": "16.8.2",
44
45
  "webpack": "^5.58.1",
45
- "webpack-bundle-analyzer": "^4.5.0",
46
- "webpack-cli": "^4.9.0",
47
46
  "webpack-dev-server": "^4.3.1",
48
47
  "webpack-merge": "^5.8.0"
49
48
  },
50
49
  "devDependencies": {
51
50
  "typescript": "^4.4.4"
52
- }
51
+ },
52
+ "keywords": [
53
+ "saturn-project",
54
+ "micro-frontend",
55
+ "no-code",
56
+ "IoT",
57
+ "saas",
58
+ "cloud",
59
+ "tuya"
60
+ ]
53
61
  }