@tuya-sat/micro-script 2.1.3 → 2.2.3
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/dist/config/webpack.common.js +25 -14
- package/package.json +4 -4
|
@@ -79,7 +79,18 @@ function getCommonConfig({ isDev, isBuild, }) {
|
|
|
79
79
|
test: /\.less$/,
|
|
80
80
|
use: getStyleLoaders({
|
|
81
81
|
importLoaders: 1,
|
|
82
|
-
},
|
|
82
|
+
}, {
|
|
83
|
+
loader: require.resolve("less-loader"),
|
|
84
|
+
options: {
|
|
85
|
+
lessOptions: Object.assign(Object.assign({}, (process.env.MICRO_THEME
|
|
86
|
+
? {
|
|
87
|
+
modifyVars: {
|
|
88
|
+
"entry-name": "light",
|
|
89
|
+
},
|
|
90
|
+
}
|
|
91
|
+
: {})), { javascriptEnabled: true }),
|
|
92
|
+
},
|
|
93
|
+
}),
|
|
83
94
|
},
|
|
84
95
|
{
|
|
85
96
|
test: /\.(scss|sass)$/,
|
|
@@ -104,26 +115,26 @@ function getCommonConfig({ isDev, isBuild, }) {
|
|
|
104
115
|
optimization: {
|
|
105
116
|
runtimeChunk: "single",
|
|
106
117
|
splitChunks: {
|
|
107
|
-
cacheGroups: {
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
118
|
+
cacheGroups: Object.assign(Object.assign({}, (process.env.MICRO_THEME
|
|
119
|
+
? {
|
|
120
|
+
vendorCss: {
|
|
121
|
+
test: /([\\/]node_modules[\\/][\s\S]+(.less|.css)$)|([\\/]src[\\/]styles[\\/]global.less)/,
|
|
122
|
+
name: "light",
|
|
123
|
+
chunks: "all",
|
|
124
|
+
priority: 2,
|
|
125
|
+
},
|
|
126
|
+
}
|
|
127
|
+
: {})), { vendor: {
|
|
115
128
|
test: /[\\/]node_modules[\\/]/,
|
|
116
129
|
name: "vendors-others",
|
|
117
130
|
chunks: "all",
|
|
118
131
|
priority: 0,
|
|
119
|
-
},
|
|
120
|
-
react: {
|
|
132
|
+
}, react: {
|
|
121
133
|
test: /[\\/]node_modules[\\/](react|react-dom)[\\/]/,
|
|
122
134
|
name: "react-related",
|
|
123
135
|
chunks: "all",
|
|
124
136
|
priority: 1,
|
|
125
|
-
},
|
|
126
|
-
},
|
|
137
|
+
} }),
|
|
127
138
|
},
|
|
128
139
|
minimizer: ["...", new css_minimizer_webpack_plugin_1.default()],
|
|
129
140
|
},
|
|
@@ -146,7 +157,7 @@ function getCommonConfig({ isDev, isBuild, }) {
|
|
|
146
157
|
filename: "static/css/[name].[contenthash:8].css",
|
|
147
158
|
chunkFilename: "static/css/[name].[contenthash:8].chunk.css",
|
|
148
159
|
}),
|
|
149
|
-
isBuild &&
|
|
160
|
+
isBuild && process.env.MICRO_THEME && new micro_dev_loader_1.ThemePlugin(),
|
|
150
161
|
].filter((value) => Boolean(value)),
|
|
151
162
|
};
|
|
152
163
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tuya-sat/micro-script",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.2.3",
|
|
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.
|
|
24
|
-
"@tuya-sat/micro-dev-proxy": "2.
|
|
25
|
-
"@tuya-sat/micro-utils": "2.
|
|
23
|
+
"@tuya-sat/micro-dev-loader": "2.2.3",
|
|
24
|
+
"@tuya-sat/micro-dev-proxy": "2.2.3",
|
|
25
|
+
"@tuya-sat/micro-utils": "2.2.3",
|
|
26
26
|
"babel-loader": "8.2.4",
|
|
27
27
|
"babel-plugin-import": "1.13.3",
|
|
28
28
|
"chalk": "4.1.2",
|