Skip to content

Commit

Permalink
add stat code
Browse files Browse the repository at this point in the history
  • Loading branch information
minwe committed Dec 9, 2015
1 parent b4037f5 commit 444ebc0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/_app/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,6 @@
<div id="root">
</div>
<script src="app__ENV__.js"></script>
<!--STAT_CODE_START--><script>var _hmt=_hmt||[];!function(){var t=document.createElement("script");t.src="//hm.baidu.com/hm.js?b424d39312c46404f15e22574a531fbb",(document.getElementsByTagName("head")[0]||document.getElementsByTagName("body")[0]).appendChild(t)}();</script><div style="display:none"><script type="text/javascript">var cnzz_protocol="https:"==document.location.protocol?" https://":" http://";document.write(unescape("%3Cspan id='cnzz_stat_icon_1256061744'%3E%3C/span%3E%3Cscript src='"+cnzz_protocol+"s95.cnzz.com/z_stat.php%3Fid%3D1256061744%26show%3Dpic1' type='text/javascript'%3E%3C/script%3E"));</script></div><!--STAT_CODE_END-->
</body>
</html>
5 changes: 5 additions & 0 deletions gulpfile.babel.js
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,11 @@ gulp.task('docs:replace', () => {
const replaceEnv = function(options) {
return gulp.src(options.src)
.pipe($.replace(rFrom, rTo))
// replace stat code on dev
.pipe($.replace(/<!--STAT_CODE_START-->(.+)<!--STAT_CODE_END-->/g,
(match, $1) => {
return isProduction ? $1 : '';
}))
.pipe(gulp.dest(options.dist));
};
let docs = replaceEnv({
Expand Down

0 comments on commit 444ebc0

Please sign in to comment.