Преглед на файлове

added basic webpack template

Brandon Wong преди 7 години
родител
ревизия
ca22717f12
променени са 6 файла, в които са добавени 63 реда и са изтрити 0 реда
  1. 8 0
      webpack/.babelrc
  2. 6 0
      webpack/.gitignore
  3. 13 0
      webpack/index.html
  4. 21 0
      webpack/package.json
  5. 8 0
      webpack/src/main.js
  6. 7 0
      webpack/styles/style.css

+ 8 - 0
webpack/.babelrc

@@ -0,0 +1,8 @@
+{
+  "presets": ["es2015"],
+  "env": {
+    "production": {
+      "plugins": ["transform-remove-console"]
+    }
+  }
+}

+ 6 - 0
webpack/.gitignore

@@ -0,0 +1,6 @@
+.idea
+node_modules
+build
+test-build
+npm-debug*
+*.swp

+ 13 - 0
webpack/index.html

@@ -0,0 +1,13 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="UTF-8">
+    <title>$foldername</title>
+    <link rel="stylesheet" href="styles/style.css">
+</head>
+<body>
+    <h2>$foldername</h2>
+    <div id="container"></div>
+    <script src="build/bundle.js"></script>
+</body>
+</html>

+ 21 - 0
webpack/package.json

@@ -0,0 +1,21 @@
+{
+  "name": "@kolab/$foldername",
+  "version": "0.1.0",
+  "main": "build/main.js",
+  "scripts": {
+    "test": "echo \"Error: no test specified\" && exit 1",
+    "compile": "babel src --out-dir build && webpack build/main.js build/bundle.js",
+    "watch": "nodemon --watch src --exec \"npm run compile\""
+  },
+  "dependencies": {
+    "babel-cli": "^6.14.0",
+    "babel-plugin-transform-remove-console": "^6.8.0",
+    "babel-preset-es2015": "^6.14.0",
+    "cross-env": "^1.0.8",
+    "webpack": "^1.13.2"
+  },
+  "devDependencies": {
+    "nodemon": "^1.9.1"
+  },
+  "private": true
+}

+ 8 - 0
webpack/src/main.js

@@ -0,0 +1,8 @@
+
+import {randomBytes} from 'crypto';
+
+
+document.write('hi there, Mr. '+randomBytes(4).toString('hex'));
+
+
+

+ 7 - 0
webpack/styles/style.css

@@ -0,0 +1,7 @@
+/* styles */
+
+
+
+
+
+