tweak installation scripts, add webpack to backend

This commit is contained in:
iamBadgers
2024-06-12 23:42:59 -07:00
parent 9df2470f65
commit a64a7ae702
3 changed files with 9 additions and 5 deletions

View File

@@ -8,7 +8,7 @@
"lint": "eslint . --ext .js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore", "lint": "eslint . --ext .js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore",
"format": "prettier --write src/", "format": "prettier --write src/",
"dev": "npx ts-node-dev src/app.ts", "dev": "npx ts-node-dev src/app.ts",
"build": "npx tsc" "build": "webpack && cp package.json ./dist/package.json"
}, },
"keywords": [], "keywords": [],
"author": "", "author": "",

View File

@@ -3,6 +3,7 @@ const NodePolyfillPlugin = require("node-polyfill-webpack-plugin")
const nodeExternals = require('webpack-node-externals'); const nodeExternals = require('webpack-node-externals');
module.exports = { module.exports = {
mode: 'production',
entry: './src/app.ts', entry: './src/app.ts',
module: { module: {
rules: [ rules: [
@@ -12,13 +13,15 @@ module.exports = {
exclude: /node_modules/, exclude: /node_modules/,
}, },
], ],
}, }, node: {
__dirname: false
},
resolve: { resolve: {
extensions: ['.tsx', '.ts', '.js'], extensions: ['.tsx', '.ts', '.js'],
}, },
output: { output: {
filename: 'bundle.js', filename: 'app.js',
path: path.resolve(__dirname, '../dist'), path: path.resolve(__dirname, './dist'),
}, },
plugins: [ plugins: [
new NodePolyfillPlugin(), new NodePolyfillPlugin(),

View File

@@ -1,11 +1,12 @@
#!/bin/bash #!/bin/bash
parent_path=$( cd "$(dirname "${BASH_SOURCE[0]}")" ; pwd -P ) parent_path=$( cd "$(dirname "${BASH_SOURCE[0]}")" ; pwd -P )
echo "" echo ""
echo "---" echo "---"
echo "Moving the distributable folder into /srv/gamestats" echo "Moving the distributable folder into /srv/gamestats"
echo "---" echo "---"
cp -r "$parent_path"/dist /srv/gamestats cp -rf "$parent_path"/dist /srv/gamestats
echo "" echo ""
echo "---" echo "---"