在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):Modernizr/gulp-modernizr开源软件地址(OpenSource Url):https://github.com/Modernizr/gulp-modernizr开源编程语言(OpenSource Language):JavaScript 100.0%开源软件介绍(OpenSource Introduction):gulp-modernizrNote: This plugin uses version 3 of Modernizr. Make sure to check the Github repo for the correct feature names (example: UsageFirst, install npm install --save-dev gulp-modernizr Then, add it to your var modernizr = require('gulp-modernizr');
gulp.task('modernizr', function() {
return gulp.src('./js/*.js')
.pipe(modernizr())
.pipe(gulp.dest('build/'))
}); Running the plugin will search for tests in your if (!Modernizr.objectfit) { doSomethingLikeCallAPolyfill(); } and in this case add the 'objectfit' test to the ouptut file. APImodernizr(fileName)fileNameType: You can optionally pass a fileName to name the Modernizr file (defaults to gulp.src('./js/*.js')
.pipe(modernizr('modernizr-custom.js')); modernizr(/*fileName, */ settings)settingsType: You can pass settings as an object. See the customizr repository for valid settings. gulp.src('./js/*.js')
.pipe(modernizr({
'options': ['setClasses'],
'tests': [
'webworkers',
[
'cssgrid',
'cssgridlegacy'
]
],
excludeTests: ['csstransforms3d']
})
); The 'settings' object can also be required from a JSON file: modernizr-config.json: {
'options': ['setClasses'],
'tests': [
'webworkers',
[
'cssgrid',
'cssgridlegacy'
]
],
excludeTests: ['csstransforms3d']
} gulpfile.js: gulp.src('./js/*.js')
.pipe(modernizr(require('./modernizr-config.json'))) Available Settingscustomizr repository for valid settings.See the
|
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论