mirror of
https://github.com/spacebarchat/server.git
synced 2026-07-28 18:29:26 +00:00
🐛 fix tsc compiler
This commit is contained in:
+25
-11
@@ -2,18 +2,32 @@ const { execSync } = require("child_process");
|
||||
const path = require("path");
|
||||
const fse = require("fs-extra");
|
||||
|
||||
const api = path.join(__dirname, "..", "..", "api");
|
||||
const dist = path.join(__dirname, "..", "dist");
|
||||
fse.copySync(path.join(__dirname, "..", "..", "api", "assets"), path.join(__dirname, "..", "dist", "api", "assets"));
|
||||
fse.copySync(
|
||||
path.join(__dirname, "..", "..", "api", "client_test"),
|
||||
path.join(__dirname, "..", "dist", "api", "client_test")
|
||||
);
|
||||
fse.copySync(path.join(__dirname, "..", "..", "api", "locales"), path.join(__dirname, "..", "dist", "api", "locales"));
|
||||
fse.copySync(path.join(__dirname, "..", "..", "api", "src"), path.join(__dirname, "..", "dist", "api", "src"));
|
||||
fse.copySync(path.join(__dirname, "..", "..", "util", "src"), path.join(__dirname, "..", "dist", "util", "src"));
|
||||
fse.copySync(path.join(__dirname, "..", "..", "cdn", "src"), path.join(__dirname, "..", "dist", "cdn", "src"));
|
||||
fse.copySync(path.join(__dirname, "..", "..", "gateway", "src"), path.join(__dirname, "..", "dist", "gateway", "src"));
|
||||
fse.copySync(path.join(__dirname, "..", "..", "bundle", "src"), path.join(__dirname, "..", "dist", "bundle", "src"));
|
||||
|
||||
fse.copySync(path.join(api, "assets"), path.join(dist, "api", "assets"));
|
||||
fse.copySync(path.join(api, "client_test"), path.join(dist, "api", "client_test"));
|
||||
fse.copySync(path.join(api, "locales"), path.join(dist, "api", "locales"));
|
||||
console.log("Copying src files done");
|
||||
console.log("Compiling src files ...");
|
||||
|
||||
console.log(
|
||||
execSync("node " + path.join(__dirname, "..", "node_modules", "typescript", "lib", "tsc.js") + " -p .", {
|
||||
cwd: path.join(__dirname, ".."),
|
||||
shell: true,
|
||||
env: process.env,
|
||||
encoding: "utf8",
|
||||
})
|
||||
execSync(
|
||||
"node " +
|
||||
path.join(__dirname, "..", "node_modules", "typescript", "lib", "tsc.js") +
|
||||
" -p " +
|
||||
path.join(__dirname, ".."),
|
||||
{
|
||||
cwd: path.join(__dirname, ".."),
|
||||
shell: true,
|
||||
env: process.env,
|
||||
encoding: "utf8",
|
||||
}
|
||||
)
|
||||
);
|
||||
|
||||
+6
-15
@@ -1,16 +1,11 @@
|
||||
{
|
||||
"include": [
|
||||
"../api/src/**/*.ts",
|
||||
"../gateway/src/**/*.ts",
|
||||
"../cdn/src/**/*.ts",
|
||||
"../util/src/**/*.ts",
|
||||
"src/**/*.ts"
|
||||
],
|
||||
"include": ["dist/**/*.ts"],
|
||||
"exclude": [],
|
||||
"compilerOptions": {
|
||||
/* Visit https://aka.ms/tsconfig.json to read more about this file */
|
||||
|
||||
/* Basic Options */
|
||||
"incremental": true /* Enable incremental compilation */,
|
||||
"incremental": false /* Enable incremental compilation */,
|
||||
"target": "ES6" /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', or 'ESNEXT'. */,
|
||||
"module": "commonjs" /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */,
|
||||
"lib": ["ES2021"] /* Specify library files to be included in the compilation. */,
|
||||
@@ -22,7 +17,7 @@
|
||||
"sourceMap": false /* Generates corresponding '.map' file. */,
|
||||
// "outFile": "./", /* Concatenate and emit output to single file. */
|
||||
"outDir": "./dist/" /* Redirect output structure to the directory. */,
|
||||
"rootDir": "../" /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */,
|
||||
"rootDir": "./dist/" /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */,
|
||||
// "composite": true, /* Enable project compilation */
|
||||
// "tsBuildInfoFile": "./", /* Specify file to store incremental compilation information */
|
||||
// "removeComments": true, /* Do not emit comments to output. */
|
||||
@@ -73,16 +68,12 @@
|
||||
"emitDecoratorMetadata": true,
|
||||
"experimentalDecorators": true,
|
||||
"resolveJsonModule": true,
|
||||
"baseUrl": "..",
|
||||
"baseUrl": "./dist/",
|
||||
"paths": {
|
||||
"@fosscord/api": ["api/src/index"],
|
||||
"@fosscord/api/*": ["api/src/*"],
|
||||
"@fosscord/gateway": ["gateway/src/index"],
|
||||
"@fosscord/gateway/*": ["gateway/src/*"],
|
||||
"@fosscord/cdn": ["cdn/src/index"],
|
||||
"@fosscord/cdn/*": ["cdn/src/*"],
|
||||
"@fosscord/util": ["util/src/index"],
|
||||
"@fosscord/util/*": ["util/src/*"]
|
||||
"@fosscord/util": ["util/src/index"]
|
||||
},
|
||||
"plugins": [{ "transform": "@zerollup/ts-transform-paths" }]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user