@newlogic-digital/core 0.9.8 → 0.9.11
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/modules/Core.js +4 -2
- package/modules/Serve.js +3 -3
- package/modules/Templates.js +1 -1
- package/package.json +1 -1
package/modules/Core.js
CHANGED
@@ -36,6 +36,7 @@ let Config = {
|
|
36
36
|
index: "/",
|
37
37
|
mode: "",
|
38
38
|
https: false,
|
39
|
+
cert: 'localhost',
|
39
40
|
reload: (file) => (file.endsWith('.php') || file.endsWith('.tpl') || file.endsWith('.latte')) && !file.includes('temp/'),
|
40
41
|
vite: {}
|
41
42
|
},
|
@@ -43,6 +44,7 @@ let Config = {
|
|
43
44
|
paths: {
|
44
45
|
temp: "temp",
|
45
46
|
cdn: "temp/cdn",
|
47
|
+
base: "",
|
46
48
|
input: {
|
47
49
|
root: "src",
|
48
50
|
main: "src/main.json",
|
@@ -61,7 +63,7 @@ let Config = {
|
|
61
63
|
icons: "public/assets/css",
|
62
64
|
emails: "public",
|
63
65
|
emailsImg: "public/img",
|
64
|
-
emailsWww: "
|
66
|
+
emailsWww: "app/Presenters/emails",
|
65
67
|
assets: "public/assets"
|
66
68
|
}
|
67
69
|
},
|
@@ -324,7 +326,7 @@ class Core {
|
|
324
326
|
let contents = file.contents.toString();
|
325
327
|
|
326
328
|
contents = contents.replace(new RegExp(`${Config.paths.input.assets}`, 'g'),
|
327
|
-
`${Config.paths.output.assets.replace(Config.paths.output.root + "/", "")}`)
|
329
|
+
`${Config.paths.output.assets.replace(Config.paths.output.root + "/", Config.paths.base.length > 0 ? Config.paths.base + "/" : "")}`)
|
328
330
|
|
329
331
|
file.contents = Buffer.from(contents);
|
330
332
|
|
package/modules/Serve.js
CHANGED
@@ -74,12 +74,12 @@ export const Serve = new class {
|
|
74
74
|
root: process.cwd(),
|
75
75
|
};
|
76
76
|
|
77
|
-
if (fs.existsSync(path.join(os.homedir()
|
77
|
+
if (fs.existsSync(path.join(os.homedir(),`.ssh/${Config.serve.cert}.pem`)) && Config.serve.https) {
|
78
78
|
lodash.merge(config, {
|
79
79
|
server: {
|
80
80
|
https: {
|
81
|
-
key: fs.readFileSync(path.join(os.homedir()
|
82
|
-
cert: fs.readFileSync(path.join(os.homedir()
|
81
|
+
key: fs.readFileSync(path.join(os.homedir(),`.ssh/${Config.serve.cert}-key.pem`)),
|
82
|
+
cert: fs.readFileSync(path.join(os.homedir(),`.ssh/${Config.serve.cert}.pem`)),
|
83
83
|
},
|
84
84
|
hmr: {
|
85
85
|
host: 'localhost'
|
package/modules/Templates.js
CHANGED
@@ -185,7 +185,7 @@ export class Templates {
|
|
185
185
|
}
|
186
186
|
|
187
187
|
if (Config.paths.output.rewrite && url.indexOf(`/${Config.paths.output.root}`) === 0) {
|
188
|
-
url = url.replace(`/${Config.paths.output.root}`, "")
|
188
|
+
url = url.replace(`/${Config.paths.output.root}`, Config.paths.base.length > 0 ? `/${Config.paths.base}` : "")
|
189
189
|
}
|
190
190
|
|
191
191
|
return url;
|
package/package.json
CHANGED