Skip to content

Commit

Permalink
feat: Adding the basics
Browse files Browse the repository at this point in the history
  • Loading branch information
taranraj123 committed Oct 12, 2024
1 parent b0ade00 commit e0f3984
Show file tree
Hide file tree
Showing 7 changed files with 94 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
3 changes: 3 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Ignore artifacts:
build
coverage
1 change: 1 addition & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
29 changes: 29 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"name": "odin-restaurant-page",
"version": "1.0.0",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"build": "webpack --config webpack.prod.js",
"dev": "webpack serve --open --config webpack.dev.js"
},
"keywords": [],
"author": "Taran Raj <https://github.com/taranraj123>",
"license": "ISC",
"description": "The Odin Project's Restaurant Page Task",
"devDependencies": {
"@eslint/js": "^9.10.0",
"css-loader": "^7.1.2",
"eslint": "^9.10.0",
"eslint-config-prettier": "^9.1.0",
"globals": "^15.9.0",
"html-loader": "^5.1.0",
"html-webpack-plugin": "^5.6.0",
"prettier": "3.3.3",
"style-loader": "^4.0.0",
"webpack": "^5.94.0",
"webpack-cli": "^5.1.4",
"webpack-dev-server": "^5.1.0",
"webpack-merge": "^6.0.1"
}
}
36 changes: 36 additions & 0 deletions webpack.common.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
// webpack.config.js
const path = require("path");
const HtmlWebpackPlugin = require("html-webpack-plugin");

module.exports = {
entry: "./src/index.js",

output: {
filename: "main.js",
path: path.resolve(__dirname, "dist"),
clean: true,
},

plugins: [
new HtmlWebpackPlugin({
template: "./src/template.html",
}),
],

module: {
rules: [
{
test: /\.css$/i,
use: ["style-loader", "css-loader"],
},
{
test: /\.html$/i,
loader: "html-loader",
},
{
test: /\.(png|svg|jpg|jpeg|gif)$/i,
type: "asset/resource",
},
],
},
};
18 changes: 18 additions & 0 deletions webpack.dev.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
const { merge } = require("webpack-merge");
const common = require("./webpack.common.js");

module.exports = merge(common, {
mode: "development",
devtool: "inline-source-map",
devServer: {
watchFiles: [
"./src/template.html",
"./src/styles.css",
"./src/header/header.css",
"./src/home/home.css",
"./src/about/about.css",
"./src/menu/menu.css",
],
static: "./dist",
},
});
6 changes: 6 additions & 0 deletions webpack.prod.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
const { merge } = require("webpack-merge");
const common = require("./webpack.common.js");

module.exports = merge(common, {
mode: "production",
});

0 comments on commit e0f3984

Please sign in to comment.