Webpack fixes

This commit is contained in:
2021-01-30 13:17:46 +02:00
parent 1f6740c9df
commit bed31b29ff
7 changed files with 215 additions and 691 deletions

887
client/package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -5,7 +5,8 @@
"main": "dist/app.js", "main": "dist/app.js",
"scripts": { "scripts": {
"tsc": "tsc -w", "tsc": "tsc -w",
"build": "webpack" "build": "webpack",
"start": "webpack serve --watch"
}, },
"repository": { "repository": {
"type": "git", "type": "git",
@@ -23,9 +24,7 @@
"express": "^4.17.1", "express": "^4.17.1",
"p5": "^1.2.0", "p5": "^1.2.0",
"socket.io": "^3.1.0", "socket.io": "^3.1.0",
"socket.io-client": "^3.1.0" "socket.io-client": "^3.1.0",
},
"devDependencies": {
"@types/express": "^4.17.11", "@types/express": "^4.17.11",
"@types/p5": "^0.9.1", "@types/p5": "^0.9.1",
"@types/socket.io": "^2.1.13", "@types/socket.io": "^2.1.13",
@@ -34,5 +33,6 @@
"webpack": "^5.19.0", "webpack": "^5.19.0",
"webpack-cli": "^4.4.0", "webpack-cli": "^4.4.0",
"webpack-dev-server": "^3.11.2" "webpack-dev-server": "^3.11.2"
} },
"devDependencies": {}
} }

File diff suppressed because one or more lines are too long

View File

@@ -1 +0,0 @@
/*! p5.js v1.2.0 December 19, 2020 */

File diff suppressed because one or more lines are too long

View File

@@ -4,7 +4,8 @@ module.exports = {
entry: './src/app.ts', entry: './src/app.ts',
output: { output: {
filename: 'bundle.js', filename: 'bundle.js',
path: path.resolve(__dirname, 'static/assets') path: path.resolve(__dirname, 'dist'),
publicPath: 'dist',
}, },
devtool: 'inline-source-map', devtool: 'inline-source-map',
module: { module: {

View File

@@ -87,6 +87,7 @@ const players = new Players()
app.use(cors()) app.use(cors())
app.use(express.static(path.join(__dirname, '/../../client/static/assets'))) app.use(express.static(path.join(__dirname, '/../../client/static/assets')))
app.use(express.static(path.join(__dirname, '/../../client/dist')))
app.get('/', function(req, res) { app.get('/', function(req, res) {
res.sendFile('index.html', { root: __dirname + '/../../client/static/'}); res.sendFile('index.html', { root: __dirname + '/../../client/static/'});