swico 3.1.0-beta.4 → 3.1.0-beta.6
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/package.json
CHANGED
package/src/command/start.js
CHANGED
|
@@ -23,8 +23,7 @@ const package_json_1 = __importDefault(require("../../package.json"));
|
|
|
23
23
|
const chalk_1 = __importDefault(require("chalk"));
|
|
24
24
|
const fs_extra_1 = __importDefault(require("fs-extra"));
|
|
25
25
|
const core_1 = require("@rsbuild/core");
|
|
26
|
-
const { SWICO_DEV_RESTART
|
|
27
|
-
let currentRouterBase = '/';
|
|
26
|
+
const { SWICO_DEV_RESTART } = process.env;
|
|
28
27
|
const handleWatch = (projectPath, devServer, env) => {
|
|
29
28
|
const envPath = env === 'dev' ? '/.dev/' : '/.prod/';
|
|
30
29
|
const configFilesWatcher = chokidar_1.default
|
|
@@ -75,7 +74,7 @@ const handleWatch = (projectPath, devServer, env) => {
|
|
|
75
74
|
}));
|
|
76
75
|
};
|
|
77
76
|
const restartServer = () => {
|
|
78
|
-
const result = cross_spawn_1.default.sync('cross-env', ['SWICO_DEV_RESTART=true',
|
|
77
|
+
const result = cross_spawn_1.default.sync('cross-env', ['SWICO_DEV_RESTART=true', 'swico', 'start'], {
|
|
79
78
|
stdio: 'inherit'
|
|
80
79
|
});
|
|
81
80
|
if (result.error) {
|
|
@@ -134,10 +133,7 @@ function start() {
|
|
|
134
133
|
const { server } = yield rsbuild.startDevServer();
|
|
135
134
|
createCompileListener(rsbuild);
|
|
136
135
|
handleWatch(projectPath, server, env);
|
|
137
|
-
|
|
138
|
-
(SWICO_DEV_RESTART === 'true' && newRouterBase !== SWICO_DEV_ROUTER_BASE)) {
|
|
139
|
-
utils_1.toast.info(`Project is running at:${chalk_1.default.hex('#29abe0')(`${customConfig.dev.https ? 'https' : 'http'}://localhost:${rsbuild.context.devServer.port}${newRouterBase}`)}`);
|
|
140
|
-
}
|
|
136
|
+
utils_1.toast.info(`Project is running at:${chalk_1.default.hex('#29abe0')(`${customConfig.dev.https ? 'https' : 'http'}://localhost:${rsbuild.context.devServer.port}${newRouterBase}`)}`);
|
|
141
137
|
const proxyConfig = startConfig.server.proxy;
|
|
142
138
|
if (proxyConfig &&
|
|
143
139
|
(Array.isArray(proxyConfig)
|
|
@@ -145,7 +141,6 @@ function start() {
|
|
|
145
141
|
: Object.keys(proxyConfig).length > 0)) {
|
|
146
142
|
utils_1.toast.info('Proxy service is enabled');
|
|
147
143
|
}
|
|
148
|
-
currentRouterBase = newRouterBase;
|
|
149
144
|
}
|
|
150
145
|
catch (e) {
|
|
151
146
|
const strErr = e.toString();
|
package/src/main-config/index.js
CHANGED
|
@@ -101,7 +101,8 @@ const getProjectConfig = (env) => __awaiter(void 0, void 0, void 0, function* ()
|
|
|
101
101
|
'devtool',
|
|
102
102
|
'externals',
|
|
103
103
|
'router',
|
|
104
|
-
'template'
|
|
104
|
+
'template',
|
|
105
|
+
'reactCompiler'
|
|
105
106
|
];
|
|
106
107
|
configFileName = 'swico.ts';
|
|
107
108
|
break;
|
|
@@ -112,6 +113,7 @@ const getProjectConfig = (env) => __awaiter(void 0, void 0, void 0, function* ()
|
|
|
112
113
|
'https',
|
|
113
114
|
'devtool',
|
|
114
115
|
'router',
|
|
116
|
+
'port',
|
|
115
117
|
'responseHeaders'
|
|
116
118
|
];
|
|
117
119
|
configFileName = 'swico.dev.ts';
|
|
@@ -99,6 +99,9 @@ function default_1(options) {
|
|
|
99
99
|
logger: {
|
|
100
100
|
log: () => { },
|
|
101
101
|
error: (message) => {
|
|
102
|
+
if (templateType === 'vue' && message.includes('Extensions changed')) {
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
102
105
|
utils_1.toast.error(message, { title: 'TypeScript errors' });
|
|
103
106
|
}
|
|
104
107
|
},
|