-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial project structure with webpack and webpack-plugin and watch mode
- Loading branch information
0 parents
commit 2e88007
Showing
9 changed files
with
7,074 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/node_modules/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<title>Output Management</title> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"><script defer src="dist/main.js"></script></head> | ||
<body> | ||
</body> | ||
</html> |
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
"name": "todo", | ||
"version": "1.0.0", | ||
"description": "", | ||
"private": true, | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1", | ||
"watch": "webpack --watch", | ||
"build": "webpack" | ||
}, | ||
"keywords": [], | ||
"author": "", | ||
"license": "ISC", | ||
"devDependencies": { | ||
"css-loader": "^6.7.1", | ||
"html-webpack-plugin": "^5.5.0", | ||
"style-loader": "^3.3.1", | ||
"webpack": "^5.71.0", | ||
"webpack-cli": "^4.9.2", | ||
"webpack-dev-server": "^4.8.1" | ||
}, | ||
"start": "webpack serve --open" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import printMe from "./print.js"; | ||
import css from './style.css'; | ||
printMe(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export default function printMe() { | ||
console.log('I get called from print.js!'); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
body { | ||
background-color: blanchedalmond; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
const HtmlWebpackPlugin = require("html-webpack-plugin"); | ||
module.exports = { | ||
module: { | ||
rules: [ | ||
{ | ||
test: /\.css$/i, | ||
use: ["style-loader", "css-loader"], | ||
}, | ||
], | ||
}, | ||
devServer: { | ||
static: "./dist", | ||
}, | ||
|
||
mode: "development", | ||
entry: "./src/index.js", | ||
output: { | ||
filename: "main.js", | ||
publicPath: "dist", | ||
}, | ||
|
||
plugins: [ | ||
new HtmlWebpackPlugin({ | ||
title: "Output Management", | ||
}), | ||
], | ||
}; |