优化项目结构,优化构建脚本,优化README.MD
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
18
build.js
18
build.js
@ -3,9 +3,11 @@ import exec from 'shelljs.exec'
|
||||
|
||||
const productionVersion = "1.0"
|
||||
|
||||
const build = exec('git log -n 1 --pretty=format:"%h on %as with key %GK"', { async: false }).stdout
|
||||
const build = exec('git log -n 1 --pretty=format:"%h-%GK"', { async: false }).stdout
|
||||
const type = exec('git log -n 1 --pretty=format:"%D"', { async: false }).stdout
|
||||
const buildDate = new Date().toTimeString()
|
||||
|
||||
|
||||
const banner = `
|
||||
==========================================================================
|
||||
__ _____ ______ __ __ _ __
|
||||
@ -24,18 +26,22 @@ const banner = `
|
||||
`
|
||||
|
||||
console.log(banner)
|
||||
console.log("Creating a production build...")
|
||||
|
||||
if(type.indexOf('stable') === -1) {
|
||||
console.warn("⚠ 警告: 此版本不是正式版,运行可能会存在性能、安全、稳定度等严重风险,请谨慎使用!\n")
|
||||
}
|
||||
|
||||
console.log("正在创建运行时文件...")
|
||||
|
||||
esbuild.build({
|
||||
entryPoints: ['./src/index.js'],
|
||||
outfile: './production/lsp-yggdrasil.full.js',
|
||||
outfile: './production/lsp-yggdrasil.full.cjs',
|
||||
bundle: true,
|
||||
platform: 'node',
|
||||
target: 'es2018',
|
||||
external: ['./config.js'],
|
||||
banner: {
|
||||
js: `/*\n${banner}\n*/`
|
||||
js: `/*\n${banner}\n*/;const PROGRAM_PRODUCTION = true;`
|
||||
},
|
||||
}).then(() => {
|
||||
console.log("Done! Enjoy the yggdrasil server as FAST as LSP")
|
||||
console.log("一份运行时文件已保存在 production/lsp-yggdrasil.full.js,您可以尽情的体验和LSP一样快的世界树服务器了!")
|
||||
})
|
Reference in New Issue
Block a user