gpt4 book ai didi

javascript - 我在关键操作中遇到错误

转载 作者:行者123 更新时间:2023-11-28 01:06:35 24 4
gpt4 key购买 nike

错误

"npm gulp critical" error
Unhandled rejection Error: No usable stylesheets found in html source. Try to specify the stylesheets manually.


我的密码

gulp.task('critical', function() {
log('Creating Critical CSS bundles');

critical.generate({
src: 'https://www.ciceksepeti.com/',
dest: config.criticalDir + '/critical-home.css',
minify: true,
ignore: ['@font-face', /url\(/, /footer/, /class/, /:vertical/, /:horizontal/],
include: [/user-/, /product-search/, /products__banner/, /order-tracking-form/, /live-search__text-find/, '.form-control', '.price', /.price__/, /products__item-img--city/],
width: 1600
}).then(function(output) {
log('Replace Css Home Run');
gulp.src(config.criticalDir + 'CriticalHomeCss.cshtml')
.pipe(replace({
patterns: [{
match: /@font-face/g,
replacement: '@@font-face'
},
{
match: /@media/g,
replacement: '@@media'
},
{
match: /@-ms/g,
replacement: '@@-ms'
},
{
match: 'criticalCss',
replacement: fs.readFileSync(config.criticalDir + '/critical-home.css', 'utf8')
}
]
}))
.pipe(gulp.dest('Views/Critical/'));
}).error(function(err) {
log('error => ' + err)
});
});

最佳答案

我发现一个线程可能是您的问题,但是除非我能看到您的html,否则我不知道。下面的线程来自GitHub上的一个问题,我认为它提供了很多详细信息。

https://github.com/addyosmani/critical/issues/277

关于javascript - 我在关键操作中遇到错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52325635/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com