Skip to content

cascornelissen/val-loader-modernizr

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Modernizr configuration for val-loader

npm npm license

This configuration is meant to be used in conjunction with val-loader and will compile a custom Modernizr build based on a configuration file that has to be provided.

The setup is based on the official documentation and doesn't include modernizr or val-loader as dependencies, allowing you to use any supported version.

Installation

npm install val-loader-modernizr val-loader modernizr --save-dev

Usage

Webpack configuration
Add a module rule to the Webpack configuration using val-loader as the loader with the executableFile option set to val-loader-modernizr.

module.exports = {
    module: {
        rules: [{
            test: /\.modernizrrc$/,
            use: [{
                loader: 'val-loader',
                options: {
                    executableFile: require.resolve('val-loader-modernizr')
                }
            }]
        }]
    }
}

Modernizr configuration
Create a Modernizr configuration file and enable the options and feature detects that are needed.

{
    "enableClasses": true,
    "minify": true,
    "feature-detects": [
        
    ]
}

Importing
Import the file where needed, the loader will take care of compiling a build and injecting it into the bundle.

import './.modernizrrc';

License

This project is licensed under the MIT license.

About

Modernizr configuration for val-loader

Resources

License

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published