@tuya-sat/micro-script 1.0.3 → 1.0.4
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/scripts/start.js +4 -3
- package/package.json +3 -3
package/dist/scripts/start.js
CHANGED
|
@@ -24,7 +24,7 @@ const webpack_config_1 = __importDefault(require("../config/webpack.config"));
|
|
|
24
24
|
const mock_1 = __importDefault(require("../module/mock"));
|
|
25
25
|
const options_1 = __importDefault(require("../module/options"));
|
|
26
26
|
const isMobile = ((_a = fs_extra_1.default.readJSONSync(paths_1.default.manifest).supportedPlatform) === null || _a === void 0 ? void 0 : _a[0]) === "MOBILE";
|
|
27
|
-
const { debuggerConfig, needMainLayout = !isMobile, } = require(paths_1.default.microConfig);
|
|
27
|
+
const { debuggerConfig, devServerConfig = (value) => value, needMainLayout = !isMobile, } = require(paths_1.default.microConfig);
|
|
28
28
|
const config = Object.assign(Object.assign({}, (0, webpack_config_1.default)()), {
|
|
29
29
|
//下面所有配置都是为了精简terminal输出
|
|
30
30
|
infrastructureLogging: {
|
|
@@ -40,7 +40,7 @@ needMainLayout && new micro_dev_loader_1.LayoutMockPlugin().apply(compiler);
|
|
|
40
40
|
stopPort: defaultPort + 100,
|
|
41
41
|
});
|
|
42
42
|
const spinner = (0, ora_1.default)(`starting dev server in ${port} port`).start();
|
|
43
|
-
const server = new webpack_dev_server_1.default({
|
|
43
|
+
const server = new webpack_dev_server_1.default(devServerConfig({
|
|
44
44
|
static: paths_1.default.dist,
|
|
45
45
|
hot: true,
|
|
46
46
|
liveReload: false,
|
|
@@ -50,6 +50,7 @@ needMainLayout && new micro_dev_loader_1.LayoutMockPlugin().apply(compiler);
|
|
|
50
50
|
"Access-Control-Allow-Origin": "*",
|
|
51
51
|
"Access-Control-Allow-Headers": "*",
|
|
52
52
|
},
|
|
53
|
+
historyApiFallback: true,
|
|
53
54
|
setupMiddlewares(middlewares, { app }) {
|
|
54
55
|
needMainLayout && micro_dev_loader_1.LayoutMockPlugin.useLayoutStatic(app);
|
|
55
56
|
middlewares.push(options_1.default);
|
|
@@ -60,7 +61,7 @@ needMainLayout && new micro_dev_loader_1.LayoutMockPlugin().apply(compiler);
|
|
|
60
61
|
}
|
|
61
62
|
return middlewares;
|
|
62
63
|
},
|
|
63
|
-
}, compiler);
|
|
64
|
+
}), compiler);
|
|
64
65
|
compiler.hooks.watchRun.tap("MyPlugin", () => {
|
|
65
66
|
spinner.isSpinning && spinner.succeed();
|
|
66
67
|
spinner.color = "yellow";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tuya-sat/micro-script",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.4",
|
|
4
4
|
"bin": "./dist/bin/cli.js",
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"license": "MIT",
|
|
@@ -15,8 +15,8 @@
|
|
|
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": "1.0.
|
|
19
|
-
"@tuya-sat/micro-dev-proxy": "1.0.
|
|
18
|
+
"@tuya-sat/micro-dev-loader": "1.0.4",
|
|
19
|
+
"@tuya-sat/micro-dev-proxy": "1.0.4",
|
|
20
20
|
"babel-loader": "^8.2.2",
|
|
21
21
|
"babel-plugin-import": "^1.13.3",
|
|
22
22
|
"chalk": "4.1.2",
|