Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hirasso/parcel-plugin-modernizr
A Parcel plugin for generating custom modernizr builds ⚙️
https://github.com/hirasso/parcel-plugin-modernizr
Last synced: about 2 months ago
JSON representation
A Parcel plugin for generating custom modernizr builds ⚙️
- Host: GitHub
- URL: https://github.com/hirasso/parcel-plugin-modernizr
- Owner: hirasso
- License: mit
- Created: 2018-09-02T22:52:09.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-10-05T10:11:54.000Z (over 6 years ago)
- Last Synced: 2024-11-20T20:46:24.619Z (2 months ago)
- Language: JavaScript
- Homepage:
- Size: 74.2 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-parcel - Modernizr - Generates a custom modernizr build (Plugins / Other)
README
# parcel-plugin-modernizr [![Build Status](https://travis-ci.com/hirasso/parcel-plugin-modernizr.svg?branch=master)](https://travis-ci.com/hirasso/parcel-plugin-modernizr)
A [Parcel](https://github.com/parcel-bundler/parcel) plugin for generating custom [Modernizr](https://github.com/Modernizr/Modernizr) builds ⚙️##### Please note: Since `v1.1.0`, the functionality of this plugin changed. See [setup instructions](#setup) 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:
```json
{
"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:
1. .modernizrrc
2. package.json under key "modernizr"
3. directly inside "modernizr.mdrnzr"See [https://github.com/Modernizr/Modernizr/blob/master/lib/config-all.json](https://github.com/Modernizr/Modernizr/blob/master/lib/config-all.json) for all available options.
## Usage option 1: Embedded in html
./src/index.html:
```html
```
./src/modernizr.mdrnzr: Your modernizr config (or empty if using one of the other options)```
$ parcel ./src/index.html
```#### Output
1. ./dist/index.html:
```html
```
2. ./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