Skip to content

Commit 1314558

Browse files
author
Ashwin Hegde
committed
Merge pull request #1 from hegdeashwin/develop
Develop
2 parents 9713555 + 557a417 commit 1314558

File tree

15 files changed

+97
-0
lines changed

15 files changed

+97
-0
lines changed

codes/example-1/entry.js

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

codes/example-1/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 1</title>
6+
</head>
7+
<body>
8+
<script type="text/javascript" src="bundle.js"></script>
9+
</body>
10+
</html>

codes/example-2/content.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
module.exports = "Hello webpack";

codes/example-2/entry.js

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

codes/example-2/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 2</title>
6+
</head>
7+
<body>
8+
<script type="text/javascript" src="bundle.js"></script>
9+
</body>
10+
</html>

codes/example-3/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-3/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!./style.css");
4+
5+
console.log(require("./content.js"));

codes/example-3/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 3</title>
6+
</head>
7+
<body>
8+
<script type="text/javascript" src="bundle.js"></script>
9+
</body>
10+
</html>

codes/example-3/style.css

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

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|

package.json

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"name": "learning-webpack",
3+
"version": "0.0.0",
4+
"description": "Basic understanding of webpack via examples",
5+
"main": "index.js",
6+
"scripts": {
7+
"test": "echo \"Error: no test specified\" && exit 1"
8+
},
9+
"repository": {
10+
"type": "git",
11+
"url": "git+https://github.com/hegdeashwin/learning-webpack.git"
12+
},
13+
"keywords": [
14+
"webpack",
15+
"bundle",
16+
"module"
17+
],
18+
"author": "Ashwin Hegde",
19+
"license": "MIT",
20+
"bugs": {
21+
"url": "https://github.com/hegdeashwin/learning-webpack/issues"
22+
},
23+
"homepage": "https://github.com/hegdeashwin/learning-webpack#readme",
24+
"devDependencies": {
25+
"css-loader": "^0.23.0",
26+
"style-loader": "^0.13.0"
27+
}
28+
}

0 commit comments

Comments
 (0)