本文介绍了使用gulp-modernizr如何指定功能选项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的包括我试图将以下选项注入工具,如下所示:

My custom Moderniser build includes the following options which I am trying to inject into the gulp-modernizr tool as follows:

gulp.task('modernizr', function() {
  allUISrcPlusSassSrc
    .pipe(modernizr({
      options: [
        'backdropfilter',
        'backgroundsize',
        'bgpositionxy',
        'bgrepeatspace_bgrepeatround',
        'bgsizecover',
        'borderradius',
        'cssanimations',
        'cssfilters',
        'csspointerevents',
        'csspseudoanimations',
        'csspseudotransitions',
        'cssremunit',
        'csstransforms',
        'csstransitions',
        'customevent',
        'devicemotion_deviceorientation',
        'eventlistener',
        'flexbox',
        'fontface',
        'json',
        'nthchild',
        'opacity',
        'overflowscrolling',
        'rgba',
        'svg',
        'svgasimg',
        'svgfilters',
        'touchevents',
        'xhrresponsetypejson',
        'domprefixes',
        'setclasses',
        'shiv'
      ]
    }))
    .pipe(gulp.dest("./output/js/vendor/"))
});

但是运行它会导致构建自定义的Modernizr {[错误:错误: ENOENT:没有这样的文件或目录,打开'/ Users / davesag / src / test-project / node_modules / modernizr / lib /../ src / backgroundsize.js'

查看 ./ node_modules / modernizr / src 我看不到任何与这些选项匹配的文件。我只是误解了什么吗?这些功能名称来自我的包含以下选项,我试图将其注入。

Looking in ./node_modules/modernizr/src I can't see any files that match these options. Am I just misunderstanding something? These feature names came straight from my custom-built modernizr file as downloaded previously from the moderniser website includes the following options which I am trying to inject into the gulp-modernizr.

省略它构建的选项,但没有选项我没有将任何功能类注入到我页面的HTML元素中。假设自动检测的东西似乎不起作用。

Leaving out the options it builds okay but without the options I'm not getting any feature-classes injected into the HTML element of my page. The supposed auto-detect stuff does not seem to be working.

我检查了自定义页面,看起来我正在做的是对的。但显然情况并非如此。

I checked the Customizr page as per the docs and it seems what I am doing is right. But clearly that's not the case.

我应该怎么做?

推荐答案

选项是指Modernizr构建器页面左侧的选项。这些通常是API和便利功能,如 Modernizr.mq Modernizr.atRule 等。

options refers to the options that are on the left hand side of the Modernizr builder page. These are typically APIs and convenience functions like Modernizr.mq, Modernizr.atRule, etc.

您想使用测试选项

这篇关于使用gulp-modernizr如何指定功能选项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-16 06:59