Skip to content

Commit 557a417

Browse files
author
AshwinH
committed
Adds example-4 + readme.md
1 parent ebec6ef commit 557a417

File tree

5 files changed

+24
-0
lines changed

5 files changed

+24
-0
lines changed

codes/example-4/content.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
console.log("Hello webpack");

codes/example-4/entry.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
console.log("Hello World");
2+
3+
require("./style.css");
4+
5+
console.log(require("./content.js"));

codes/example-4/index.html

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="utf-8">
5+
<title>Example 4</title>
6+
</head>
7+
<body>
8+
<script type="text/javascript" src="bundle.js"></script>
9+
</body>
10+
</html>

codes/example-4/style.css

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
body {
2+
background: green;
3+
}

codes/readme.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
|Example No.|Execution Command|Comments|
2+
|-----------|-----------------|--------|
3+
|1, 2| webpack entry.js bundle.js| |
4+
|3| |we need the ```css-loader``` to process CSS files. We also need the ```style-loader``` to apply the styles in the CSS file. They need to be installed locally, without ```-g```|
5+
|4|webpack entry.js bundle.js --module-bind 'css=style!css' | if you are using ```bash``` then use single quotes in Command. Please see https://github.com/webpack/webpack/issues/1453 for more information|

0 commit comments

Comments
 (0)