Browse Source

Use pug templates

Phyks (Lucas Verney) 3 years ago
parent
commit
dbcfd10b14
6 changed files with 27 additions and 27 deletions
  1. 3
    4
      app/App.vue
  2. 3
    2
      app/views/dashboardView.vue
  3. 3
    4
      app/views/publicView.vue
  4. 0
    15
      index.html
  5. 13
    0
      index.pug
  6. 5
    2
      package.json

+ 3
- 4
app/App.vue View File

@@ -1,5 +1,4 @@
1
-<template>
2
-	<div class="rsvp-app" role="application">
3
-		<router-view></router-view>
4
-	</div>
1
+<template lang="pug">
2
+  div(role="application")
3
+    router-view
5 4
 </template>

+ 3
- 2
app/views/dashboardView.vue View File

@@ -1,3 +1,4 @@
1
-<template>
2
-  <div><p>Hello world 2</p></div>
1
+<template lang="pug">
2
+  div
3
+    p {{ 'Hello world 2' }}
3 4
 </template>

+ 3
- 4
app/views/publicView.vue View File

@@ -1,5 +1,4 @@
1
-<template>
2
-  <div>
3
-    <p>Hello world</p>
4
-  </div>
1
+<template lang="pug">
2
+  div
3
+    p {{ 'Hello world' }}
5 4
 </template>

+ 0
- 15
index.html View File

@@ -1,15 +0,0 @@
1
-<!DOCTYPE html>
2
-<html lang="en">
3
-  <head>
4
-    <meta charset="utf-8">
5
-    <title>RSVP</title>
6
-    <meta name="mobile-web-app-capable" content="yes">
7
-    <meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, minimal-ui">
8
-  </head>
9
-  <body>
10
-    <div role="application"></div>
11
-
12
-    <script src="dist/commons.bundle.js"></script>
13
-    <script src="dist/app.bundle.js"></script>
14
-  </body>
15
-</html>

+ 13
- 0
index.pug View File

@@ -0,0 +1,13 @@
1
+doctype
2
+html
3
+  head
4
+    title RSVP
5
+    meta(charset="utf-8")
6
+    meta(http-equiv="X-UA-Compatible", content="IE=edge,chrome=1")
7
+    meta(name="viewport", content="width=device-width,initial-scale=1.0")
8
+
9
+  body
10
+    div(role="application")
11
+
12
+      script(src="./commons.bundle.js")
13
+      script(src="./app.bundle.js")

+ 5
- 2
package.json View File

@@ -17,8 +17,8 @@
17 17
     }
18 18
   },
19 19
   "scripts": {
20
-    "build:prod": "cross-env NODE_ENV=production webpack -p",
21
-    "build:dev": "cross-env NODE_ENV=development webpack",
20
+    "build:prod": "cross-env NODE_ENV=production webpack -p && pug --out dist/ index.pug",
21
+    "build:dev": "cross-env NODE_ENV=development webpack && pug --pretty --out dist/ index.pug",
22 22
     "lint": "standard 'app/**/*.js' 'webpack.config.js'",
23 23
     "clean": "rimraf dist/*"
24 24
   },
@@ -38,6 +38,9 @@
38 38
     "cross-env": "^3.1.3",
39 39
     "css-loader": "^0.25.0",
40 40
     "debug-loader": "0.0.1",
41
+    "pug": "^2.0.0-beta6",
42
+    "pug-cli": "^1.0.0-alpha6",
43
+    "pug-loader": "^2.3.0",
41 44
     "rimraf": "^2.5.4",
42 45
     "standard": "^8.5.0",
43 46
     "vue-loader": "^9.7.0",