diff --git a/backend/package.json b/backend/package.json index 3eb857d..66f9420 100644 --- a/backend/package.json +++ b/backend/package.json @@ -8,7 +8,7 @@ "lint": "eslint . --ext .js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore", "format": "prettier --write src/", "dev": "npx ts-node-dev src/app.ts", - "build": "npx tsc" + "build": "webpack && cp package.json ./dist/package.json" }, "keywords": [], "author": "", diff --git a/backend/webpack.config.js b/backend/webpack.config.js index 212da30..34fe353 100644 --- a/backend/webpack.config.js +++ b/backend/webpack.config.js @@ -3,6 +3,7 @@ const NodePolyfillPlugin = require("node-polyfill-webpack-plugin") const nodeExternals = require('webpack-node-externals'); module.exports = { + mode: 'production', entry: './src/app.ts', module: { rules: [ @@ -12,13 +13,15 @@ module.exports = { exclude: /node_modules/, }, ], - }, + }, node: { + __dirname: false + }, resolve: { extensions: ['.tsx', '.ts', '.js'], }, output: { - filename: 'bundle.js', - path: path.resolve(__dirname, '../dist'), + filename: 'app.js', + path: path.resolve(__dirname, './dist'), }, plugins: [ new NodePolyfillPlugin(), diff --git a/install.sh b/install.sh index 9ed0858..39013bb 100755 --- a/install.sh +++ b/install.sh @@ -1,11 +1,12 @@ #!/bin/bash parent_path=$( cd "$(dirname "${BASH_SOURCE[0]}")" ; pwd -P ) + echo "" echo "---" echo "Moving the distributable folder into /srv/gamestats" echo "---" -cp -r "$parent_path"/dist /srv/gamestats +cp -rf "$parent_path"/dist /srv/gamestats echo "" echo "---"