@unsetsoft/ryunixjs 0.2.15-nightly.5 → 0.2.15-nightly.7
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.js +11 -2
- package/bin/serve.js +10 -5
- package/package.json +3 -2
- package/webpack.config.js +12 -3
package/bin/index.js
CHANGED
|
@@ -1,14 +1,23 @@
|
|
|
1
1
|
#! /usr/bin/env node
|
|
2
2
|
const yargs = require("yargs");
|
|
3
3
|
const { hideBin } = require("yargs/helpers");
|
|
4
|
-
const {
|
|
4
|
+
const { StartServer } = require("./serve");
|
|
5
5
|
const { compiler } = require("./compiler");
|
|
6
6
|
const logger = require("terminal-log");
|
|
7
7
|
const serv = {
|
|
8
8
|
command: "server",
|
|
9
9
|
describe: "Run server",
|
|
10
10
|
handler: async (arg) => {
|
|
11
|
-
|
|
11
|
+
const port = arg.port || 3000;
|
|
12
|
+
const open = Boolean(arg.browser) || false;
|
|
13
|
+
const compress = Boolean(arg.compress) || false;
|
|
14
|
+
const settings = {
|
|
15
|
+
port: port,
|
|
16
|
+
open,
|
|
17
|
+
compress,
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
StartServer(settings);
|
|
12
21
|
},
|
|
13
22
|
};
|
|
14
23
|
|
package/bin/serve.js
CHANGED
|
@@ -2,8 +2,13 @@ const Webpack = require("webpack");
|
|
|
2
2
|
const WebpackDevServer = require("webpack-dev-server");
|
|
3
3
|
const webpackConfig = require("../webpack.config.js");
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
|
|
6
|
+
const StartServer = async (cliSettings) => {
|
|
7
|
+
const compiler = Webpack(webpackConfig);
|
|
8
|
+
const devServerOptions = { ...webpackConfig.devServer, ...cliSettings };
|
|
9
|
+
const server = new WebpackDevServer(devServerOptions, compiler);
|
|
10
|
+
|
|
11
|
+
await server.start();
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
module.exports = { StartServer };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unsetsoft/ryunixjs",
|
|
3
|
-
"version": "0.2.15-nightly.
|
|
3
|
+
"version": "0.2.15-nightly.7",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "./dist/Ryunix.js",
|
|
6
6
|
"private": false,
|
|
@@ -10,7 +10,8 @@
|
|
|
10
10
|
"homepage": "https://github.com/UnSetSoft/Ryunixjs#readme",
|
|
11
11
|
"scripts": {
|
|
12
12
|
"build": "rollup ./lib/main.js --file ./dist/Ryunix.js --format umd --name Ryunix",
|
|
13
|
-
"postinstall": "yarn build"
|
|
13
|
+
"postinstall": "yarn build",
|
|
14
|
+
"cli": "node ./bin/index.js"
|
|
14
15
|
},
|
|
15
16
|
"bin": {
|
|
16
17
|
"ryunix": "./bin/index.js"
|
package/webpack.config.js
CHANGED
|
@@ -3,8 +3,6 @@ const HtmlWebpackPlugin = require("html-webpack-plugin");
|
|
|
3
3
|
const ErrorOverlayPlugin = require("error-overlay-webpack-plugin");
|
|
4
4
|
|
|
5
5
|
const dir = path.dirname(path.resolve(path.join(__dirname, "/../", "../")));
|
|
6
|
-
console.log(path.join(dir, "src", "main.ryx"), __dirname);
|
|
7
|
-
|
|
8
6
|
module.exports = {
|
|
9
7
|
mode: "production",
|
|
10
8
|
entry: path.join(dir, "src", "main.ryx"),
|
|
@@ -15,9 +13,20 @@ module.exports = {
|
|
|
15
13
|
devtoolModuleFilenameTemplate: "ryunix/[resource-path]",
|
|
16
14
|
},
|
|
17
15
|
devServer: {
|
|
18
|
-
port: 3000,
|
|
19
16
|
historyApiFallback: { index: "/", disableDotRule: true },
|
|
20
17
|
},
|
|
18
|
+
stats: {
|
|
19
|
+
assets: false,
|
|
20
|
+
children: false,
|
|
21
|
+
chunks: false,
|
|
22
|
+
chunkModules: false,
|
|
23
|
+
colors: true,
|
|
24
|
+
entrypoints: false,
|
|
25
|
+
hash: false,
|
|
26
|
+
modules: false,
|
|
27
|
+
timings: false,
|
|
28
|
+
version: false,
|
|
29
|
+
},
|
|
21
30
|
module: {
|
|
22
31
|
rules: [
|
|
23
32
|
{
|