add webpack

This commit is contained in:
b1ek 2023-04-21 09:09:18 +10:00
parent d6053c411f
commit 7ce3c94135
Signed by: blek
GPG Key ID: 14546221E3595D0C
5 changed files with 2095 additions and 1 deletions

View File

@ -3,5 +3,13 @@
"version": "1.0.0",
"main": "index.js",
"author": "blek",
"license": "MIT"
"license": "MIT",
"devDependencies": {
"webpack": "^5.80.0",
"webpack-cli": "^5.0.1",
"webpack-dev-server": "^4.13.3"
},
"scripts": {
"dev": "webpack serve --mode development"
}
}

9
public/index.html Normal file
View File

@ -0,0 +1,9 @@
<!DOCTYPE html>
<html>
<head></head>
<body>
<div id="is-a-dev-root"></div>
<script src="bundle.js"></script>
</body>
</html>

1
src/index.js Normal file
View File

@ -0,0 +1 @@
alert('hi webpack')

15
webpack.config.js Normal file
View File

@ -0,0 +1,15 @@
const path = require('path');
module.exports = {
entry: path.resolve(__dirname, './src/index.js'),
output: {
path: path.resolve(__dirname, './public'),
filename: 'bundle.js'
},
devServer: {
static: path.resolve(__dirname, './public'),
port: process.env.APP_PORT || 8080,
host: '0.0.0.0',
allowedHosts: 'all'
}
}

2061
yarn.lock Normal file

File diff suppressed because it is too large Load Diff