@titanpl/packet 6.0.0 → 7.0.0-beta
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/index.js +19 -2
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -67,6 +67,15 @@ export async function build(root = process.cwd()) {
|
|
|
67
67
|
outDir: dist,
|
|
68
68
|
});
|
|
69
69
|
|
|
70
|
+
const tanfigPath = path.join(root, "tanfig.json");
|
|
71
|
+
if (fs.existsSync(tanfigPath)) {
|
|
72
|
+
fs.copyFileSync(tanfigPath, path.join(dist, "tanfig.json"));
|
|
73
|
+
}
|
|
74
|
+
const titanExtPath = path.join(root, "titan.json");
|
|
75
|
+
if (fs.existsSync(titanExtPath)) {
|
|
76
|
+
fs.copyFileSync(titanExtPath, path.join(dist, "titan.json"));
|
|
77
|
+
}
|
|
78
|
+
|
|
70
79
|
return dist;
|
|
71
80
|
}
|
|
72
81
|
|
|
@@ -91,7 +100,7 @@ export async function release(root = process.cwd()) {
|
|
|
91
100
|
} catch (e) { }
|
|
92
101
|
}
|
|
93
102
|
|
|
94
|
-
const filesToCopy = config.build && config.build.files ? config.build.files : ["public", "static", "db", "config"];
|
|
103
|
+
const filesToCopy = config.build && config.build.files ? config.build.files : ["public", "static", "db", "config", "tanfig.json", "titan.json"];
|
|
95
104
|
|
|
96
105
|
// Clear or ensure build dir
|
|
97
106
|
if (fs.existsSync(buildDir)) {
|
|
@@ -111,11 +120,19 @@ export async function release(root = process.cwd()) {
|
|
|
111
120
|
}
|
|
112
121
|
}
|
|
113
122
|
|
|
114
|
-
// 3. Copy package.json
|
|
123
|
+
// 3. Copy package.json & tanfig.json
|
|
115
124
|
const pkgPath = path.join(root, "package.json");
|
|
116
125
|
if (fs.existsSync(pkgPath)) {
|
|
117
126
|
fs.copyFileSync(pkgPath, path.join(buildDir, "package.json"));
|
|
118
127
|
}
|
|
128
|
+
const tanfigPath = path.join(root, "tanfig.json");
|
|
129
|
+
if (fs.existsSync(tanfigPath)) {
|
|
130
|
+
fs.copyFileSync(tanfigPath, path.join(buildDir, "tanfig.json"));
|
|
131
|
+
}
|
|
132
|
+
const titanConfigPath = path.join(root, "titan.json");
|
|
133
|
+
if (fs.existsSync(titanConfigPath)) {
|
|
134
|
+
fs.copyFileSync(titanConfigPath, path.join(buildDir, "titan.json"));
|
|
135
|
+
}
|
|
119
136
|
|
|
120
137
|
// 4. Create .env
|
|
121
138
|
fs.writeFileSync(path.join(buildDir, ".env"), "TITAN_DEV=0\n");
|