Start frontend project

This commit is contained in:
2021-04-07 21:23:21 -05:00
parent b46ec965e1
commit e04e991cfa
4 changed files with 1084 additions and 0 deletions

1035
frontend/package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

20
frontend/package.json Normal file
View File

@@ -0,0 +1,20 @@
{
"name": "frontend",
"version": "1.0.0",
"description": "",
"private": true,
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"build": "webpack"
},
"keywords": [],
"author": "",
"license": "ISC",
"devDependencies": {
"webpack": "^5.31.0",
"webpack-cli": "^4.6.0"
},
"dependencies": {
"lodash": "^4.17.21"
}
}

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

@@ -0,0 +1,20 @@
import _ from "lodash";
import "./style.css";
import Icon from './ship.png';
function component() {
const element = document.createElement("div");
// Lodash, currently included via a script, is required for this line to work
element.innerHTML = _.join(["Hello", "webpack"], " ");
element.classList.add("hello");
const myIcon = new Image();
myIcon.src = Icon;
element.appendChild(myIcon);
return element;
}
document.body.appendChild(component());

View File

@@ -0,0 +1,9 @@
const path = require("path");
module.exports = {
entry: "./src/index.js",
output: {
filename: "bundle.js",
path: path.resolve(__dirname, "dist"),
},
};