fix: cannot build prod and delete unused file
This commit is contained in:
@@ -1,14 +0,0 @@
|
||||
{
|
||||
"presets": [
|
||||
[
|
||||
"@babel/preset-env",
|
||||
{
|
||||
"targets": {
|
||||
"node": "current"
|
||||
},
|
||||
"modules": false
|
||||
}
|
||||
],
|
||||
"@babel/preset-typescript"
|
||||
]
|
||||
}
|
||||
@@ -5,7 +5,7 @@
|
||||
"main": "server.ts",
|
||||
"scripts": {
|
||||
"dev": "tsx --watch server.ts",
|
||||
"build": "tsc -b",
|
||||
"build": "tsc -b && node scripts/copy-assets.cjs",
|
||||
"start": "node dist/server.js"
|
||||
},
|
||||
"keywords": [],
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
// scripts/copy-assets.cjs
|
||||
const fs = require("fs");
|
||||
const path = require("path");
|
||||
|
||||
const rootDir = path.join(__dirname, "..");
|
||||
const distDir = path.join(rootDir, "dist");
|
||||
|
||||
const sqlFiles = fs
|
||||
.readdirSync(rootDir)
|
||||
.filter((f) => f.endsWith(".scheme.sql"));
|
||||
|
||||
for (const file of sqlFiles) {
|
||||
const srcPath = path.join(rootDir, file);
|
||||
const distPath = path.join(distDir, file);
|
||||
fs.copyFileSync(srcPath, distPath);
|
||||
console.log(`Copied ${srcPath} -> ${distPath}`);
|
||||
}
|
||||
@@ -1,5 +1,13 @@
|
||||
import js from "@eslint/js";
|
||||
import globals from "globals";
|
||||
|
||||
export default [
|
||||
js.configs.recommended,
|
||||
{
|
||||
languageOptions: {
|
||||
globals: {
|
||||
...globals.node,
|
||||
},
|
||||
},
|
||||
},
|
||||
];
|
||||
Generated
+2
-1
@@ -17,7 +17,8 @@
|
||||
"@eslint/js": "^10.0.1",
|
||||
"@types/cors": "^2.8.19",
|
||||
"@types/express": "^5.0.6",
|
||||
"concurrently": "^10.0.3"
|
||||
"concurrently": "^10.0.3",
|
||||
"globals": "^17.7.0"
|
||||
}
|
||||
},
|
||||
"backend": {
|
||||
|
||||
+2
-1
@@ -34,6 +34,7 @@
|
||||
"@eslint/js": "^10.0.1",
|
||||
"@types/cors": "^2.8.19",
|
||||
"@types/express": "^5.0.6",
|
||||
"concurrently": "^10.0.3"
|
||||
"concurrently": "^10.0.3",
|
||||
"globals": "^17.7.0"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user