forked from devsam/core
build: 빌드 환경 재 설정
- lock에 따라 npm ci로 변경 - webpack build를 서버 내에서 하므로 dev dependency가 거의 없음 - webpack build에서 gateway build를 별도로 작성
This commit is contained in:
+26
-4
@@ -3,6 +3,25 @@ namespace sammo;
|
||||
|
||||
set_time_limit(600);
|
||||
|
||||
|
||||
class Json
|
||||
{
|
||||
/** @return never */
|
||||
public static function die($value)
|
||||
{
|
||||
if (!headers_sent()) {
|
||||
header('Expires: Wed, 01 Jan 2014 00:00:00 GMT');
|
||||
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
|
||||
header('Cache-Control: no-store, no-cache, must-revalidate');
|
||||
header('Cache-Control: post-check=0, pre-check=0', false);
|
||||
header('Pragma: no-cache');
|
||||
}
|
||||
|
||||
header('Content-Type: application/json');
|
||||
die(json_encode($value));
|
||||
}
|
||||
}
|
||||
|
||||
function tryComposerInstall()
|
||||
{
|
||||
$resultPath = 'composer_result.json.log';
|
||||
@@ -29,7 +48,8 @@ function tryComposerInstall()
|
||||
if ($result_code != 0) {
|
||||
Json::die([
|
||||
'result' => false,
|
||||
'reason' => $output
|
||||
'reason' => $output,
|
||||
'state' => 'composer',
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -83,7 +103,8 @@ function tryNpmInstall()
|
||||
if ($result_code != 0) {
|
||||
Json::die([
|
||||
'result' => false,
|
||||
'reason' => $output
|
||||
'reason' => $output,
|
||||
'state' => 'npm ci',
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -105,13 +126,14 @@ function tryNpmInstall()
|
||||
|
||||
function genJS()
|
||||
{
|
||||
$command = "./node_modules/.bin/webpack build";
|
||||
$command = sprintf("./node_modules/.bin/webpack build --env target=gateway");
|
||||
|
||||
exec(($command), $output, $result_code);
|
||||
if ($result_code != 0) {
|
||||
Json::die([
|
||||
'result' => false,
|
||||
'reason' => $output
|
||||
'reason' => $output,
|
||||
'state' => 'webpack build',
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
Generated
+343
-1515
File diff suppressed because it is too large
Load Diff
+28
-30
@@ -22,6 +22,10 @@
|
||||
"license": "MIT",
|
||||
"type": "module",
|
||||
"dependencies": {
|
||||
"@babel/cli": "^7.17.6",
|
||||
"@babel/core": "^7.17.5",
|
||||
"@babel/preset-env": "^7.16.11",
|
||||
"@babel/preset-typescript": "^7.16.7",
|
||||
"@popperjs/core": "^2.11.3",
|
||||
"@tiptap/extension-color": "^2.0.0-beta.9",
|
||||
"@tiptap/extension-image": "^2.0.0-beta.27",
|
||||
@@ -32,59 +36,46 @@
|
||||
"@tiptap/starter-kit": "^2.0.0-beta.183",
|
||||
"@tiptap/vue-3": "^2.0.0-beta.90",
|
||||
"@types/bootstrap": "^5.1.9",
|
||||
"@types/downloadjs": "^1.4.3",
|
||||
"@types/linkifyjs": "^2.1.4",
|
||||
"@types/select2": "^4.0.55",
|
||||
"@types/uuid": "^8.3.4",
|
||||
"async-validator": "^4.0.7",
|
||||
"axios": "^0.26.1",
|
||||
"bootstrap": "^5.1.3",
|
||||
"bootstrap-vue-3": "=0.1.6",
|
||||
"buffer": "^6.0.3",
|
||||
"core-js": "^3.21.1",
|
||||
"date-fns": "^2.28.0",
|
||||
"downloadjs": "^1.4.7",
|
||||
"eslint-import-resolver-alias": "^1.1.2",
|
||||
"jquery": "^3.6.0",
|
||||
"js-sha512": "^0.8.0",
|
||||
"linkifyjs": "^3.0",
|
||||
"lodash": "^4.17.21",
|
||||
"query-string": "^7.1.1",
|
||||
"select2": "^4.0",
|
||||
"uuid": "^8.3.2",
|
||||
"vue": "^3.2.31",
|
||||
"vue-multiselect": "^3.0.0-alpha.2",
|
||||
"vue-types": "^4.1.1",
|
||||
"vuedraggable": "^4.1.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/cli": "^7.17.6",
|
||||
"@babel/core": "^7.17.5",
|
||||
"@babel/preset-env": "^7.16.11",
|
||||
"@babel/preset-typescript": "^7.16.7",
|
||||
"@types/chai": "^4.3.0",
|
||||
"@types/downloadjs": "^1.4.3",
|
||||
"@types/jquery": "^3.5.14",
|
||||
"@types/linkifyjs": "^2.1.4",
|
||||
"@types/lodash": "^4.14.179",
|
||||
"@types/mocha": "^9.1.0",
|
||||
"@types/node": "^17.0.21",
|
||||
"@types/react": "file:hwe/ts/@types/types__react",
|
||||
"@types/select2": "^4.0.55",
|
||||
"@types/uuid": "^8.3.4",
|
||||
"@typescript-eslint/eslint-plugin": "^5.14.0",
|
||||
"@typescript-eslint/parser": "^5.14.0",
|
||||
"@vue/compiler-sfc": "^3.2.31",
|
||||
"@vue/eslint-config-typescript": "^10.0.0",
|
||||
"async-validator": "^4.0.7",
|
||||
"autoprefixer": "^10.4.2",
|
||||
"axios": "^0.26.1",
|
||||
"babel-plugin-lodash": "^3.3.4",
|
||||
"babel-preset-modern-browsers": "^15.0.2",
|
||||
"bootstrap": "^5.1.3",
|
||||
"bootstrap-vue-3": "=0.1.6",
|
||||
"bootswatch": "^5.1.3",
|
||||
"buffer": "^6.0.3",
|
||||
"chai": "^4.3.6",
|
||||
"chai-bytes": "^0.1.2",
|
||||
"clean-terminal-webpack-plugin": "^3.0.0",
|
||||
"core-js": "^3.21.1",
|
||||
"css-loader": "^6.7.1",
|
||||
"cssnano": "^5.1.3",
|
||||
"date-fns": "^2.28.0",
|
||||
"downloadjs": "^1.4.7",
|
||||
"esbuild-loader": "^2.18.0",
|
||||
"eslint": "^8.11.0",
|
||||
"eslint-import-resolver-alias": "^1.1.2",
|
||||
"eslint-plugin-vue": "^8.5.0",
|
||||
"file-loader": "^6.2.0",
|
||||
"jquery": "^3.6.0",
|
||||
"js-sha512": "^0.8.0",
|
||||
"linkifyjs": "^3.0",
|
||||
"lodash": "^4.17.21",
|
||||
"mini-css-extract-plugin": "^2.6.0",
|
||||
"mocha": "^9.2.2",
|
||||
"npm-run-all": "^4.1.5",
|
||||
@@ -92,16 +83,23 @@
|
||||
"postcss-import": "^14.0.2",
|
||||
"postcss-loader": "^6.2.1",
|
||||
"pre-commit": "^1.2.2",
|
||||
"query-string": "^7.1.1",
|
||||
"sass": "^1.49.9",
|
||||
"sass-loader": "^12.6.0",
|
||||
"select2": "^4.0",
|
||||
"style-loader": "^3.3.1",
|
||||
"ts-node": "^10.7.0",
|
||||
"tsconfig-paths": "^3.13.0",
|
||||
"typescript": "^4.6.2",
|
||||
"url-loader": "^4.1.1",
|
||||
"uuid": "^8.3.2",
|
||||
"vue": "^3.2.31",
|
||||
"vue-eslint-parser": "^8.3.0",
|
||||
"vue-loader": "^17.0.0",
|
||||
"vue-multiselect": "^3.0.0-alpha.2",
|
||||
"vue-style-loader": "^4.1.3",
|
||||
"vue-types": "^4.1.1",
|
||||
"vuedraggable": "^4.1.0",
|
||||
"webpack": "^5.70.0",
|
||||
"webpack-bundle-analyzer": "^4.5.0",
|
||||
"webpack-cli": "^4.9.2"
|
||||
|
||||
+12
-4
@@ -8,7 +8,8 @@ const { ESBuildMinifyPlugin } = require('esbuild-loader')
|
||||
const webpack = require('webpack');
|
||||
const fs = require('fs');
|
||||
module.exports = (env, argv) => {
|
||||
const target = env.target ?? 'hwe';
|
||||
const rawTarget = env.target ?? 'hwe';
|
||||
const target = (rawTarget == 'gateway') ? 'hwe' : rawTarget;
|
||||
const mode = argv.mode ?? 'production';
|
||||
const tsDir = resolve(__dirname, `${target}/ts/`);
|
||||
const build_exports = require(`${tsDir}/build_exports.json`);
|
||||
@@ -90,8 +91,8 @@ module.exports = (env, argv) => {
|
||||
};
|
||||
|
||||
const performance = {
|
||||
maxAssetSize: 5*1024*1024,
|
||||
maxEntrypointSize: 3*1024*1024,
|
||||
maxAssetSize: 5 * 1024 * 1024,
|
||||
maxEntrypointSize: 3 * 1024 * 1024,
|
||||
}
|
||||
|
||||
const ingame_vue = {
|
||||
@@ -365,11 +366,18 @@ module.exports = (env, argv) => {
|
||||
performance,
|
||||
};
|
||||
|
||||
const buildConfList = [];
|
||||
if (rawTarget == 'gateway') {
|
||||
buildConfList.push(gateway);
|
||||
return buildConfList;
|
||||
}
|
||||
|
||||
if (env.WEBPACK_WATCH || !versionValue) {
|
||||
return [gateway, ingame_vue, ingame];
|
||||
}
|
||||
|
||||
const buildConfList = [];
|
||||
|
||||
|
||||
if (target == 'hwe' && !fs.existsSync(resolve(outputPath, `build_gateway.txt`))) {
|
||||
buildConfList.push(gateway);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user