All Projects → peerigon → Modernizr Loader

peerigon / Modernizr Loader

Licence: mit
Get your modernizr build bundled with webpack

Programming Languages

javascript
184084 projects - #8 most used programming language

Labels

Projects that are alternatives of or similar to Modernizr Loader

Froggy Service
邱威傑市民服務網站
Stars: ✭ 155 (-4.32%)
Mutual labels:  webpack
Hops
Universal Development Environment
Stars: ✭ 158 (-2.47%)
Mutual labels:  webpack
Svg Spritemap Webpack Plugin
SVG spritemap plugin for webpack
Stars: ✭ 160 (-1.23%)
Mutual labels:  webpack
Angular Electron
Angular2 and Electron starter using webpack
Stars: ✭ 155 (-4.32%)
Mutual labels:  webpack
Express Webpack React Redux Typescript Boilerplate
🎉 A full-stack boilerplate that using express with webpack, react and typescirpt!
Stars: ✭ 156 (-3.7%)
Mutual labels:  webpack
Reactn
React, but with built-in global state management.
Stars: ✭ 1,906 (+1076.54%)
Mutual labels:  webpack
Webpack Fast Refresh
React Fast Refresh plugin and loader for webpack
Stars: ✭ 155 (-4.32%)
Mutual labels:  webpack
Img Loader
Image minimizing loader for webpack
Stars: ✭ 161 (-0.62%)
Mutual labels:  webpack
Prerender Loader
📰 Painless universal pre-rendering for Webpack.
Stars: ✭ 1,908 (+1077.78%)
Mutual labels:  webpack
Github Ranking
🔍GitHub不同语言热门项目排行,Vue.js做页面展示
Stars: ✭ 160 (-1.23%)
Mutual labels:  webpack
Reactconfbr
Public infos and issues about React Conf Brasil organization
Stars: ✭ 156 (-3.7%)
Mutual labels:  webpack
Deventy
A minimal 11ty starting point for building static websites with modern tools.
Stars: ✭ 157 (-3.09%)
Mutual labels:  webpack
Awesome Vue Cli3 Example
🦅 Awesome example for rapid Vue.js development using vue-cli3 .
Stars: ✭ 160 (-1.23%)
Mutual labels:  webpack
J
微信网页版API 微信桌面机器人
Stars: ✭ 155 (-4.32%)
Mutual labels:  webpack
Blog
这是一个Blog, 如果喜欢可以订阅,是Watch, 不是 Star 哈。。。
Stars: ✭ 161 (-0.62%)
Mutual labels:  webpack
Webpack Encore
A simple but powerful API for processing & compiling assets built around Webpack
Stars: ✭ 1,975 (+1119.14%)
Mutual labels:  webpack
React Boilerplate
A slightly opinionated yet dead simple boilerplate for React 17.x, Webpack 5 and React Router v5
Stars: ✭ 158 (-2.47%)
Mutual labels:  webpack
Ts Tools
TypeScript Tools for Node.js
Stars: ✭ 162 (+0%)
Mutual labels:  webpack
Electron Vue Boilerplate
Electron & Vue.js Boilerplate
Stars: ✭ 161 (-0.62%)
Mutual labels:  webpack
Webpack Interview Questions
Webpack questions/answers you can use to prepare for interviews or test your knowledge.
Stars: ✭ 159 (-1.85%)
Mutual labels:  webpack

modernizr-loader for webpack

Build Status devDependency Status peerDependency Status

Installation

$ npm install --save-dev modernizr modernizr-loader json-loader

Initialization

You have to create a .modernizrrc configuration file and put your modernizr stuff in it. Like so

// .modernizrrc
{
  "minify": true,
  "options": [
    "setClasses"
  ],
  "feature-detects": []
}

Full list of supported "options" and "feature-detects" can be found in Modernizr config-all.json.

Webpack config

Documentation: Using loaders

Put the following code to your webpack config file:

const path = require('path');

module.exports = {
  module: {
    rules: [
      {
        test: /\.modernizrrc.js$/,
        use: [ 'modernizr-loader' ]
      },
      {
        test: /\.modernizrrc(\.json)?$/,
        use: [ 'modernizr-loader', 'json-loader' ]
      }
    ]
  },
  resolve: {
    alias: {
      modernizr$: path.resolve(__dirname, "path/to/.modernizrrc")
    }
  }
}

Usage

Now you are able to import your custom Modernizr build as a module throughout your application like so:

import Modernizr from 'modernizr';

if (!Modernizr.promises) {
    // ...
}

See the Modernizr documentation for all available options.

Contribution

Don't hesitate to create a pull request. Every contribution is appreciated.

Sponsors

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].