Socket
Book a DemoInstallSign in
Socket

parcel-plugin-modernizr

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

parcel-plugin-modernizr

A [Parcel](https://github.com/parcel-bundler/parcel) plugin for generating custom [Modernizr](https://github.com/Modernizr/Modernizr) builds ⚙️

1.1.4
latest
Source
npmnpm
Version published
Weekly downloads
14
Maintainers
1
Weekly downloads
 
Created
Source

parcel-plugin-modernizr Build Status

A Parcel plugin for generating custom Modernizr builds ⚙️

Please note: Since v1.1.0, the functionality of this plugin changed. See setup instructions on how to use it now.

Installation

Using NPM

$ npm install parcel-plugin-modernizr -D

Using Yarn

$ yarn add parcel-plugin-modernizr -D

Setup

In your project's source folder, create a file modernizr.mdrnzr and put in your Modernizr config, for example:

{
  "minify": true,
  "classPrefix" : "",
  "options": [
    "setClasses",
    "addTest"
  ],
  "feature-detects": [
    "css/pointerevents", 
    "touchevents", 
    "history"
  ]
}

You can also create a file named .modernizrrc in your project's root folder and put your config there.

Instead of using a .modernizrrc, you can also put your config inside your project's package.json under the key "modernizr".

Config hierarchy:

  • .modernizrrc
  • package.json under key "modernizr"
  • directly inside "modernizr.mdrnzr"

See https://github.com/Modernizr/Modernizr/blob/master/lib/config-all.json for all available options.

Usage option 1: Embedded in html

./src/index.html:

<script src="modernizr.mdrnzr"></script>

./src/modernizr.mdrnzr: Your modernizr config (or empty if using one of the other options)

$ parcel ./src/index.html

Output

  • ./dist/index.html:

    <script src="modernizr.contentHash.js"></script>
    
  • ./dist/modernizr.contentHash.js: Your custom modernizr build

Usage option 2: Direct

./src/modernizr.mdrnzr: Your modernizr config (or empty if using one of the other options)

$ parcel ./src/modernizr.mdrnzr

Output

./dist/modernizr.js: Your custom modernizr build

Contributing

Pull requests are welcome

FAQs

Package last updated on 05 Oct 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.