summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYuval Adam <yuval@y3xz.com>2015-12-08 12:06:16 +0200
committerYuval Adam <yuval@y3xz.com>2015-12-08 12:06:16 +0200
commitc52b19823b2575130b3ef1e133f494b176fa1500 (patch)
tree83c2a1b1765fb07bd7c38448672aecbd4c13af03
parent2b93429ff34bc489998a326c8698df54e269846a (diff)
Initial webpack stuff
-rw-r--r--.gitignore2
-rw-r--r--index.html8
-rw-r--r--index.js3
-rw-r--r--package.json6
-rw-r--r--style.css3
-rw-r--r--webpack.config.js12
6 files changed, 33 insertions, 1 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..c987c3a
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,2 @@
+node_modules/
+bundle.js \ No newline at end of file
diff --git a/index.html b/index.html
new file mode 100644
index 0000000..da9edba
--- /dev/null
+++ b/index.html
@@ -0,0 +1,8 @@
+<html>
+ <head>
+ <meta charset="utf-8">
+ </head>
+ <body>
+ <script type="text/javascript" src="bundle.js" charset="utf-8"></script>
+ </body>
+</html> \ No newline at end of file
diff --git a/index.js b/index.js
new file mode 100644
index 0000000..993e9a9
--- /dev/null
+++ b/index.js
@@ -0,0 +1,3 @@
+require("./style.css");
+
+document.write("It works."); \ No newline at end of file
diff --git a/package.json b/package.json
index 95be4e6..e9cc590 100644
--- a/package.json
+++ b/package.json
@@ -7,5 +7,9 @@
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
- "license": "ISC"
+ "license": "ISC",
+ "devDependencies": {
+ "webpack": "^1.12.9",
+ "webpack-dev-server": "^1.14.0"
+ }
}
diff --git a/style.css b/style.css
new file mode 100644
index 0000000..c0f1b2d
--- /dev/null
+++ b/style.css
@@ -0,0 +1,3 @@
+body {
+ background: #eee;
+} \ No newline at end of file
diff --git a/webpack.config.js b/webpack.config.js
new file mode 100644
index 0000000..2ccc988
--- /dev/null
+++ b/webpack.config.js
@@ -0,0 +1,12 @@
+module.exports = {
+ entry: "./index.js",
+ output: {
+ path: __dirname,
+ filename: "bundle.js"
+ },
+ module: {
+ loaders: [
+ { test: /\.css$/, loader: "style!css" }
+ ]
+ }
+}; \ No newline at end of file