@unsetsoft/ryunixjs 0.2.32-nightly.2 → 0.2.32-nightly.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/bin/index.mjs +0 -1
- package/bin/serve.mjs +10 -2
- package/package.json +1 -1
package/bin/index.mjs
CHANGED
package/bin/serve.mjs
CHANGED
|
@@ -1,13 +1,21 @@
|
|
|
1
1
|
import Webpack from "webpack";
|
|
2
2
|
import WebpackDevServer from "webpack-dev-server";
|
|
3
3
|
import webpackConfig from "../webpack.config.mjs";
|
|
4
|
-
|
|
4
|
+
import logger from "terminal-log";
|
|
5
5
|
const StartServer = async (cliSettings) => {
|
|
6
6
|
const compiler = Webpack(webpackConfig);
|
|
7
7
|
const devServerOptions = { ...webpackConfig.devServer, ...cliSettings };
|
|
8
8
|
const server = new WebpackDevServer(devServerOptions, compiler);
|
|
9
9
|
|
|
10
|
-
await server.
|
|
10
|
+
await server.startCallback((err) => {
|
|
11
|
+
if (err) {
|
|
12
|
+
return logger.error(`[error] ${err.message}`);
|
|
13
|
+
}
|
|
14
|
+
logger.ok("Welcome!");
|
|
15
|
+
logger.info(
|
|
16
|
+
`[info] Server runing at: ${webpackConfig.devServer.host}:${webpackConfig.devServer.port}`
|
|
17
|
+
);
|
|
18
|
+
});
|
|
11
19
|
};
|
|
12
20
|
|
|
13
21
|
export { StartServer };
|