val-loader-modernizr

1.0.1 • Public • Published

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.

Package Sidebar

Install

npm i val-loader-modernizr

Weekly Downloads

479

Version

1.0.1

License

MIT

Unpacked Size

5.26 kB

Total Files

4

Last publish

Collaborators

  • cascornelissen