好亂(
This commit is contained in:
@@ -1,3 +1,7 @@
|
|||||||
import config from './server/config.ts'
|
import config from './server/config.ts'
|
||||||
|
import io from './server/lib/io.js'
|
||||||
|
|
||||||
config.ensureAllDirsAreCreated()
|
config.ensureAllDirsAreCreated()
|
||||||
|
io.copyDir('./client', config.dirs.WEB_PAGE_DIR)
|
||||||
|
|
||||||
await import('./server/build.ts').then(a => a.default(config.dirs.WEB_PAGE_DIR))
|
await import('./server/build.ts').then(a => a.default(config.dirs.WEB_PAGE_DIR))
|
||||||
|
|||||||
@@ -10,11 +10,12 @@
|
|||||||
// Front-end Compiling
|
// Front-end Compiling
|
||||||
"@babel/core": "npm:@babel/core@^7.26.10",
|
"@babel/core": "npm:@babel/core@^7.26.10",
|
||||||
"@babel/preset-env": "npm:@babel/preset-env@^7.26.9",
|
"@babel/preset-env": "npm:@babel/preset-env@^7.26.9",
|
||||||
"@babel/preset-react": "npm:@babel/preset-react@^7.26.3",
|
"@babel/preset-react": "npm:@babel/preset-react@^7.26.3"
|
||||||
"babel-minify": "npm:babel-minify@^0.5.2"
|
|
||||||
},
|
},
|
||||||
"tasks": {
|
"tasks": {
|
||||||
|
// 編譯並運行
|
||||||
|
"run": "deno run --allow-read --allow-write --allow-import --allow-env --allow-net --allow-sys ./start-server.ts",
|
||||||
// 編譯前端頁面
|
// 編譯前端頁面
|
||||||
"compile-webpage": "deno run --allow-read --allow-write --allow-import --allow-env ./compile-webpage.ts"
|
"compile-webpage": "deno run --allow-read --allow-write --allow-import --allow-env --allow-sys ./compile-webpage.ts"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
4
run.sh
Normal file
4
run.sh
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
echo "主文件夾 = $HOME"
|
||||||
|
# mkdir usr_home || true
|
||||||
|
# HOME=./usr_home
|
||||||
|
deno task run
|
||||||
@@ -11,11 +11,7 @@ function compileJs(path: string) {
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
"@babel/preset-react",
|
"@babel/preset-react",
|
||||||
[
|
// "minify",
|
||||||
"minify", {
|
|
||||||
|
|
||||||
}
|
|
||||||
],
|
|
||||||
],
|
],
|
||||||
targets: {
|
targets: {
|
||||||
chrome: "53",
|
chrome: "53",
|
||||||
|
|||||||
@@ -41,4 +41,8 @@ sio.on("connection", (socket) => {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
httpApp.listen(80)
|
export {
|
||||||
|
app as expressApp,
|
||||||
|
httpApp as httpServer,
|
||||||
|
sio as SocketIoServer,
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
import './compile-webpage.ts'
|
||||||
|
|
||||||
|
import {
|
||||||
|
expressApp,
|
||||||
|
httpServer,
|
||||||
|
SocketIoServer,
|
||||||
|
} from './server/http.ts'
|
||||||
|
|
||||||
|
httpServer.listen(8080)
|
||||||
|
|
||||||
|
console.log("TheWhiteSilk server started successfully")
|
||||||
|
|||||||
Reference in New Issue
Block a user