@unsetsoft/ryunixjs 0.2.31 → 0.2.32-nightly.0
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 +2 -1
- package/utils/index.mjs +24 -1
- package/webpack.config.mjs +37 -15
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unsetsoft/ryunixjs",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.32-nightly.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "./dist/Ryunix.js",
|
|
6
6
|
"private": false,
|
|
@@ -29,6 +29,7 @@
|
|
|
29
29
|
"@babel/preset-react": "^7.22.5",
|
|
30
30
|
"@mdx-js/loader": "^2.3.0",
|
|
31
31
|
"babel-loader": "^9.1.3",
|
|
32
|
+
"crypto": "^1.0.1",
|
|
32
33
|
"css-loader": "^6.8.1",
|
|
33
34
|
"file-loader": "^6.2.0",
|
|
34
35
|
"html-loader": "^4.2.0",
|
package/utils/index.mjs
CHANGED
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
import { createHash } from "crypto";
|
|
2
|
+
import { resolve } from "path";
|
|
3
|
+
|
|
4
|
+
const resolveApp = (appDirectory, relativePath) =>
|
|
5
|
+
resolve(appDirectory, relativePath);
|
|
6
|
+
|
|
1
7
|
function getPackageManager() {
|
|
2
8
|
const agent = process.env.npm_config_user_agent;
|
|
3
9
|
|
|
@@ -24,4 +30,21 @@ function getPackageManager() {
|
|
|
24
30
|
return "npm";
|
|
25
31
|
}
|
|
26
32
|
|
|
27
|
-
|
|
33
|
+
const ENV_HASH = (env) => {
|
|
34
|
+
const hash = createHash("md5");
|
|
35
|
+
hash.update(JSON.stringify(env));
|
|
36
|
+
|
|
37
|
+
return hash.digest("hex");
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
const RYUNIX_APP = /^RYUNIX_APP_/i;
|
|
41
|
+
|
|
42
|
+
const getEnviroment = () =>
|
|
43
|
+
Object.keys(process.env)
|
|
44
|
+
.filter((key) => RYUNIX_APP.test(key))
|
|
45
|
+
.reduce((env, key) => {
|
|
46
|
+
env[key] = process.env[key];
|
|
47
|
+
return env;
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
export { getPackageManager, ENV_HASH, getEnviroment, resolveApp };
|
package/webpack.config.mjs
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import { fileURLToPath } from "url";
|
|
2
2
|
import { dirname, join, resolve } from "path";
|
|
3
3
|
import HtmlWebpackPlugin from "html-webpack-plugin";
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
import {
|
|
5
|
+
getPackageManager,
|
|
6
|
+
ENV_HASH,
|
|
7
|
+
getEnviroment,
|
|
8
|
+
resolveApp,
|
|
9
|
+
} from "./utils/index.mjs";
|
|
10
|
+
import fs from "fs";
|
|
7
11
|
const __filename = fileURLToPath(import.meta.url);
|
|
8
12
|
|
|
9
13
|
const __dirname = dirname(__filename);
|
|
@@ -16,6 +20,8 @@ if (manager === "yarn" || manager === "npm" || manager === "bun") {
|
|
|
16
20
|
throw new Error(`The manager ${manager} is not supported.`);
|
|
17
21
|
}
|
|
18
22
|
|
|
23
|
+
const host = process.env.HOST || "0.0.0.0";
|
|
24
|
+
|
|
19
25
|
export default {
|
|
20
26
|
mode: "production",
|
|
21
27
|
entry: join(dir, "src", "main.ryx"),
|
|
@@ -23,13 +29,23 @@ export default {
|
|
|
23
29
|
output: {
|
|
24
30
|
path: join(dir, ".ryunix"),
|
|
25
31
|
chunkFilename: "./assets/js/[name].[fullhash:8].bundle.js",
|
|
32
|
+
assetModuleFilename: "./assets/media/[name].[hash][ext]",
|
|
26
33
|
filename: "./assets/js/[name].[fullhash:8].bundle.js",
|
|
27
34
|
devtoolModuleFilenameTemplate: "ryunix/[resource-path]",
|
|
28
35
|
clean: true,
|
|
29
36
|
},
|
|
30
37
|
devServer: {
|
|
31
38
|
hot: true,
|
|
32
|
-
historyApiFallback: {
|
|
39
|
+
historyApiFallback: {
|
|
40
|
+
index: "/",
|
|
41
|
+
disableDotRule: true,
|
|
42
|
+
},
|
|
43
|
+
headers: {
|
|
44
|
+
"Access-Control-Allow-Origin": "*",
|
|
45
|
+
"Access-Control-Allow-Methods": "*",
|
|
46
|
+
"Access-Control-Allow-Headers": "*",
|
|
47
|
+
},
|
|
48
|
+
compress: true,
|
|
33
49
|
},
|
|
34
50
|
optimization: {
|
|
35
51
|
runtimeChunk: "single",
|
|
@@ -39,18 +55,24 @@ export default {
|
|
|
39
55
|
minSize: 0,
|
|
40
56
|
},
|
|
41
57
|
},
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
58
|
+
cache: {
|
|
59
|
+
type: "filesystem",
|
|
60
|
+
version: ENV_HASH(getEnviroment),
|
|
61
|
+
cacheDirectory: resolveApp(dir, "node_modules/.cache"),
|
|
62
|
+
store: "pack",
|
|
63
|
+
buildDependencies: {
|
|
64
|
+
defaultWebpack: ["webpack/lib/"],
|
|
65
|
+
config: [__filename],
|
|
66
|
+
tsconfig: [
|
|
67
|
+
resolveApp(dir, "tsconfig.json"),
|
|
68
|
+
resolveApp(dir, "jsconfig.json"),
|
|
69
|
+
].filter((f) => fs.existsSync(f)),
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
infrastructureLogging: {
|
|
73
|
+
level: "none",
|
|
53
74
|
},
|
|
75
|
+
stats: "errors-warnings",
|
|
54
76
|
module: {
|
|
55
77
|
rules: [
|
|
56
78
|
{
|