Add frontend to be served by backend.

This commit is contained in:
2020-12-28 15:19:09 +01:00
parent 94226c140e
commit 391be9b833
18 changed files with 4905 additions and 8 deletions

7
frontend/src/index.js Normal file
View File

@@ -0,0 +1,7 @@
console.log('Hello world! ++++++');
document.getElementById('content').innerHTML = `
<div>
<h1>Hello world!</h1>
</div>
`;

View File

@@ -0,0 +1,24 @@
const webpack = require("webpack");
const path = require("path");
const UglifyJSPlugin = require("uglifyjs-webpack-plugin");
let config = {
entry: "./frontend/src/index.js",
output: {
path: path.resolve(__dirname, "../backend/public"),
filename: "bundle.js"
},
devServer: {
contentBase: path.resolve(__dirname, "../backend/public"),
historyApiFallback: true,
inline: true,
open: true,
hot: true
},
plugins: [
new UglifyJSPlugin(),
new webpack.SourceMapDevToolPlugin({})
],
devtool: "eval-source-map"
}
module.exports = config;