Add frontend to be served by backend.
This commit is contained in:
7
frontend/src/index.js
Normal file
7
frontend/src/index.js
Normal file
@@ -0,0 +1,7 @@
|
||||
console.log('Hello world! ++++++');
|
||||
|
||||
document.getElementById('content').innerHTML = `
|
||||
<div>
|
||||
<h1>Hello world!</h1>
|
||||
</div>
|
||||
`;
|
||||
24
frontend/webpack.config.js
Normal file
24
frontend/webpack.config.js
Normal 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;
|
||||
Reference in New Issue
Block a user