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",
"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": "",

View File

@@ -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(),