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}`);
|
||||
}
|
||||
Reference in New Issue
Block a user