@tuya-sat/micro-script 2.2.12 → 2.2.13
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.
|
@@ -12,6 +12,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
12
12
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
13
|
};
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
const fs_extra_1 = __importDefault(require("fs-extra"));
|
|
15
16
|
//@ts-ignore
|
|
16
17
|
const copy_webpack_plugin_1 = __importDefault(require("copy-webpack-plugin"));
|
|
17
18
|
//@ts-ignore
|
|
@@ -21,6 +22,9 @@ const css_minimizer_webpack_plugin_1 = __importDefault(require("css-minimizer-we
|
|
|
21
22
|
const micro_dev_loader_1 = require("@tuya-sat/micro-dev-loader");
|
|
22
23
|
const micro_utils_1 = require("@tuya-sat/micro-utils");
|
|
23
24
|
const paths_1 = __importDefault(require("./paths"));
|
|
25
|
+
const isExistPostcssFile = () => {
|
|
26
|
+
return fs_extra_1.default.existsSync("postcss.config.js");
|
|
27
|
+
};
|
|
24
28
|
function getCommonConfig({ isDev, isBuild, }) {
|
|
25
29
|
const { name: packageName } = require(paths_1.default.appPkg);
|
|
26
30
|
//获取style处理的loader
|
|
@@ -40,14 +44,17 @@ function getCommonConfig({ isDev, isBuild, }) {
|
|
|
40
44
|
* dev环境就不需要postcss-loader了
|
|
41
45
|
* 默认应该比较新的浏览器了
|
|
42
46
|
*/
|
|
43
|
-
isBuild && {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
47
|
+
isBuild && Object.assign({ loader: require.resolve("postcss-loader") }, (() => {
|
|
48
|
+
return isExistPostcssFile()
|
|
49
|
+
? {}
|
|
50
|
+
: {
|
|
51
|
+
options: {
|
|
52
|
+
postcssOptions: {
|
|
53
|
+
plugins: ["postcss-preset-env"],
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
};
|
|
57
|
+
})()),
|
|
51
58
|
extraLoader,
|
|
52
59
|
].filter(Boolean);
|
|
53
60
|
return loaders;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tuya-sat/micro-script",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.13",
|
|
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": "2.2.
|
|
24
|
-
"@tuya-sat/micro-dev-proxy": "2.2.
|
|
25
|
-
"@tuya-sat/micro-utils": "2.2.
|
|
23
|
+
"@tuya-sat/micro-dev-loader": "2.2.13",
|
|
24
|
+
"@tuya-sat/micro-dev-proxy": "2.2.13",
|
|
25
|
+
"@tuya-sat/micro-utils": "2.2.13",
|
|
26
26
|
"babel-loader": "8.2.4",
|
|
27
27
|
"babel-plugin-import": "1.13.3",
|
|
28
28
|
"chalk": "4.1.2",
|