Skip to content

Commit 8a1ec34

Browse files
committed
Getting started with webpack
1 parent b69ee77 commit 8a1ec34

8 files changed

Lines changed: 73 additions & 0 deletions

File tree

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Getting Started with webpack
2+
3+
> [https://www.youtube.com/watch?v=TaWKUpahFZM](https://www.youtube.com/watch?v=TaWKUpahFZM)
4+
5+
Install [io.js](https://iojs.org/en/index.html).
6+
7+
Within this folder run the terminal command `npm install` to install the
8+
`dependencies` and `devDependencies`.
9+
10+
Then run `npm start` to build as you edit files while viewing `http://localhost:8080`
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
body {
2+
background-color: green;
3+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
@import 'base.css';
2+
3+
div {
4+
color: red;
5+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
var $ = require('jquery')
2+
3+
require('./bear.css')
4+
5+
module.exports = $('<div/>').html('grizzly growl!')
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></title>
6+
</head>
7+
<body>
8+
<script src="bundle.js" charset="utf-8"></script>
9+
</body>
10+
</html>
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
require(['./bear.js'], function (bear) {
2+
document.body.appendChild(bear[0])
3+
})
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"name": "getting-started-with-webpack",
3+
"version": "0.1.0",
4+
"main": "index.js",
5+
"scripts": {
6+
"start": "webpack-dev-server ./index.js"
7+
},
8+
"author": "Kyle Robinson Young <kyle@dontkry.com> (http://dontkry.com)",
9+
"license": "MIT",
10+
"devDependencies": {
11+
"css-loader": "^0.15.1",
12+
"style-loader": "^0.12.3",
13+
"webpack": "^1.10.1",
14+
"webpack-dev-server": "^1.10.1"
15+
},
16+
"dependencies": {
17+
"css-loader": "~0.15.1",
18+
"jquery": "^2.1.4",
19+
"node-libs-browser": "~0.5.2",
20+
"style-loader": "~0.12.3",
21+
"webpack": "~1.10.1",
22+
"webpack-dev-server": "~1.10.1"
23+
},
24+
"description": ""
25+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
module.exports = {
2+
entry: './index.js',
3+
output: {
4+
path: __dirname,
5+
filename: 'bundle.js'
6+
},
7+
module: {
8+
loaders: [
9+
{ test: /\.css$/, loader: 'style!css!' }
10+
]
11+
}
12+
}

0 commit comments

Comments
 (0)