@tuya-sat/micro-script 3.3.1 → 3.3.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.
|
@@ -2,9 +2,9 @@ import { Configuration } from 'webpack';
|
|
|
2
2
|
import { ThemeCat } from '@tuya-sat/micro-dev-loader/dist/less/utils/index';
|
|
3
3
|
declare type ThemeEnv = ThemeCat | undefined;
|
|
4
4
|
export declare const validateMicroTheme: () => ThemeEnv;
|
|
5
|
-
export default function getCommonConfig({
|
|
6
|
-
port?: number;
|
|
5
|
+
export default function getCommonConfig({ isDev, isBuild, port, }: {
|
|
7
6
|
isDev: boolean;
|
|
8
7
|
isBuild: boolean;
|
|
8
|
+
port?: number;
|
|
9
9
|
}): Configuration;
|
|
10
10
|
export {};
|
|
@@ -64,7 +64,7 @@ const validateMicroTheme = () => {
|
|
|
64
64
|
return microTheme;
|
|
65
65
|
};
|
|
66
66
|
exports.validateMicroTheme = validateMicroTheme;
|
|
67
|
-
function getCommonConfig({
|
|
67
|
+
function getCommonConfig({ isDev, isBuild, port, }) {
|
|
68
68
|
const { name: packageName } = require(paths_1.default.appPkg);
|
|
69
69
|
const devMicroTheme = (0, exports.validateMicroTheme)();
|
|
70
70
|
const enableThemeCompile = isDev
|
|
@@ -105,7 +105,7 @@ function getCommonConfig({ port, isDev, isBuild, }) {
|
|
|
105
105
|
const baseConfig = {
|
|
106
106
|
mode: isBuild ? 'production' : 'development',
|
|
107
107
|
output: {
|
|
108
|
-
publicPath:
|
|
108
|
+
publicPath: isDev && isMainApp && port ? `http://0.0.0.0/${port}/` : undefined,
|
|
109
109
|
filename: isBuild
|
|
110
110
|
? 'static/js/[name].[contenthash:8].js'
|
|
111
111
|
: 'static/js/[name].bundle.js',
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import webpack, { Compiler } from 'webpack';
|
|
2
2
|
import { Configuration } from 'webpack-dev-server';
|
|
3
3
|
export declare type CustomDevServer = (value: Configuration) => typeof value;
|
|
4
|
-
export declare function createServerCompiler(
|
|
4
|
+
export declare function createServerCompiler(port?: number): webpack.Compiler;
|
|
5
5
|
export declare function runBundleServer({ port, compiler, internalDevConfig, }: {
|
|
6
6
|
port: number;
|
|
7
7
|
compiler: Compiler;
|
|
@@ -33,8 +33,8 @@ const webpack_config_1 = __importDefault(require("../config/webpack.config"));
|
|
|
33
33
|
const options_1 = __importDefault(require("./options"));
|
|
34
34
|
const onceFactory_1 = require("../utils/onceFactory");
|
|
35
35
|
const promiser_1 = require("../utils/promiser");
|
|
36
|
-
function createServerCompiler(
|
|
37
|
-
const config = Object.assign(Object.assign({}, (0, webpack_config_1.default)(
|
|
36
|
+
function createServerCompiler(port) {
|
|
37
|
+
const config = Object.assign(Object.assign({}, (0, webpack_config_1.default)(port)), {
|
|
38
38
|
//下面所有配置都是为了精简terminal输出
|
|
39
39
|
infrastructureLogging: {
|
|
40
40
|
level: 'warn',
|
|
@@ -49,9 +49,9 @@ export const reWriteUI = () => {
|
|
|
49
49
|
bindCmp(result, nav, 'nav');
|
|
50
50
|
|
|
51
51
|
const layout = (require as any).context(
|
|
52
|
-
'../../src
|
|
52
|
+
'../../src',
|
|
53
53
|
true,
|
|
54
|
-
|
|
54
|
+
/\.\/layout\/.*\.([tj]sx?)$/
|
|
55
55
|
);
|
|
56
56
|
bindCmp(result, layout, 'layout');
|
|
57
57
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tuya-sat/micro-script",
|
|
3
|
-
"version": "3.3.
|
|
3
|
+
"version": "3.3.3",
|
|
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.3.
|
|
27
|
-
"@tuya-sat/micro-dev-proxy": "3.3.
|
|
28
|
-
"@tuya-sat/micro-utils": "3.3.
|
|
26
|
+
"@tuya-sat/micro-dev-loader": "3.3.3",
|
|
27
|
+
"@tuya-sat/micro-dev-proxy": "3.3.3",
|
|
28
|
+
"@tuya-sat/micro-utils": "3.3.3",
|
|
29
29
|
"@types/kill-port": "^2.0.0",
|
|
30
30
|
"babel-loader": "8.2.4",
|
|
31
31
|
"babel-plugin-import": "1.13.3",
|