Skip to content

Commit

Permalink
chore(gulp): update gulpfile
Browse files Browse the repository at this point in the history
  • Loading branch information
SukkaW committed May 29, 2020
1 parent 4545737 commit 0b7db01
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 16 deletions.
34 changes: 19 additions & 15 deletions gulpfile.js
Expand Up @@ -20,27 +20,31 @@ const cssBanner = ['/*! DisqusJS - Default Theme | v<%= pkg.version %>',
].join(' | ');


const browserslist = [
'last 3 versions',
'since 2016',
'> 1%',
'Chrome >= 49',
'Firefox >= 50',
'ie >= 11',
'Safari >= 9',
]

const configs = {
browsers: [
'last 2 versions',
'since 2015',
'> 1%',
'Chrome >= 49',
'Firefox >= 44',
'ie >= 10',
'Safari >= 9',
],
autoprefixer: {
overrideBrowserslist: browserslist
},
cleanCSS: {
compatibility: 'ie10'
compatibility: 'ie11'
},
};

gulp.task('minify-js', () => gulp.src('src/**/*.js')
.pipe(babel({
"presets": [
["@babel/env", {
"targets": configs.browsers,
"loose": true
'presets': [
['@babel/env', {
'targets': browserslist,
'loose': true
}]
]
}))
Expand All @@ -51,7 +55,7 @@ gulp.task('minify-js', () => gulp.src('src/**/*.js')
.pipe(gulp.dest('dist')));

gulp.task('minify-css', () => gulp.src('src/**/*.css')
.pipe(autoprefixer(configs.browsers))
.pipe(autoprefixer(configs.autoprefixer))
.pipe(cleanCSS(configs.cleanCSS))
.pipe(header(cssBanner, { pkg }))
.pipe(gulp.dest('dist')));
Expand Down
2 changes: 1 addition & 1 deletion src/disqus.js
Expand Up @@ -271,7 +271,7 @@ function DisqusJS(config) {
disqusjs.page = { id, title, isClosed, length, comment: [] };

// 在 #disqus_thread 中填充 DisqusJS Container
$$(DISQUS_CONTAINER_EL_ID).innerHTML = `<div id="dsqjs"><div id="dsqjs-msg">评论基础模式加载中... ${HTML_TPL_EL_ASK_FOR_FULL}</div>${HTML_TPL_EL_HEADER(resp.posts, disqusjs.config.siteName)}<section class="dsqjs-post-container"><ul class="dsqjs-post-list" id="dsqjs-post-container"><p class="dsqjs-no-comment">评论列表加载中...</p></ul><a id="dsqjs-load-more" class="dsqjs-load-more dsqjs-hide">加载更多评论</a></section>${HTML_TPL_EL_FOOTER}</div>`;
$$(DISQUS_CONTAINER_EL_ID).innerHTML = `<div id="dsqjs"><div id="dsqjs-msg">评论基础模式加载中... ${HTML_TPL_EL_ASK_FOR_FULL}</div>${HTML_TPL_EL_HEADER(length, disqusjs.config.siteName)}<section class="dsqjs-post-container"><ul class="dsqjs-post-list" id="dsqjs-post-container"><p class="dsqjs-no-comment">评论列表加载中...</p></ul><a id="dsqjs-load-more" class="dsqjs-load-more dsqjs-hide">加载更多评论</a></section>${HTML_TPL_EL_FOOTER}</div>`;

assignClickEventForAskForFulButton();

Expand Down

0 comments on commit 0b7db01

Please sign in to comment.