dinou 1.4.2 → 1.4.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/dinou/register-paths.js +27 -0
- package/dinou/render-html.js +1 -0
- package/dinou/server.js +1 -0
- package/dinou/ssg.js +1 -0
- package/package.json +2 -1
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
const tsconfigPaths = require("tsconfig-paths");
|
|
2
|
+
const path = require("path");
|
|
3
|
+
const fs = require("fs");
|
|
4
|
+
|
|
5
|
+
function getConfigFileIfExists() {
|
|
6
|
+
const tsconfigPath = path.resolve(process.cwd(), "tsconfig.json");
|
|
7
|
+
const jsconfigPath = path.resolve(process.cwd(), "jsconfig.json");
|
|
8
|
+
|
|
9
|
+
if (fs.existsSync(tsconfigPath)) return tsconfigPath;
|
|
10
|
+
if (fs.existsSync(jsconfigPath)) return jsconfigPath;
|
|
11
|
+
|
|
12
|
+
return null;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
const configFile = getConfigFileIfExists();
|
|
16
|
+
|
|
17
|
+
if (configFile) {
|
|
18
|
+
const config = require(configFile);
|
|
19
|
+
const { baseUrl, paths } = config.compilerOptions || {};
|
|
20
|
+
|
|
21
|
+
if (baseUrl && paths) {
|
|
22
|
+
tsconfigPaths.register({
|
|
23
|
+
baseUrl: path.resolve(process.cwd(), baseUrl),
|
|
24
|
+
paths,
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
}
|
package/dinou/render-html.js
CHANGED
package/dinou/server.js
CHANGED
package/dinou/ssg.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dinou",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.3",
|
|
4
4
|
"description": "Minimal React 19 Framework",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"bin": {
|
|
@@ -43,6 +43,7 @@
|
|
|
43
43
|
"postcss-loader": "^8.1.1",
|
|
44
44
|
"react-server-dom-webpack": "^19.1.0",
|
|
45
45
|
"tailwindcss": "^4.1.10",
|
|
46
|
+
"tsconfig-paths": "^4.2.0",
|
|
46
47
|
"tsconfig-paths-webpack-plugin": "^4.2.0",
|
|
47
48
|
"webpack": "^5.99.8",
|
|
48
49
|
"webpack-cli": "^6.0.1",
|