ソースを参照

Merge pull request #93 from QingWei-Li/fix/template-file

fix template file
FuryBean 9 年 前
コミット
4087e7a474
2 ファイル変更3 行追加3 行削除
  1. 2 2
      examples/index.tpl
  2. 1 1
      scripts/cooking.demo.js

+ 2 - 2
examples/index.template.html → examples/index.tpl

@@ -8,7 +8,7 @@
   <body>
     <div id="app"></div>
   </body>
-  <script>
+  <% if (process.env.NODE_ENV === 'production') { %><script>
     (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
     (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
     m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
@@ -16,5 +16,5 @@
 
     ga('create', 'UA-84335471-1', 'auto');
     ga('send', 'pageview');
-  </script>
+  </script><% } %>
 </html>

+ 1 - 1
scripts/cooking.demo.js

@@ -17,7 +17,7 @@ cooking.set({
     vendor: ['vue', 'vue-router']
   },
   dist: './examples/element-ui/',
-  template: './examples/index.template.html',
+  template: './examples/index.tpl',
   publicPath: '/element-ui/',
   hash: true,
   devServer: {