New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

modernizr-loader

Package Overview
Dependencies
Maintainers
2
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

modernizr-loader - npm Package Compare versions

Comparing version 0.0.5 to 1.0.0

.travis.yml

5

CHANGELOG.md

@@ -0,1 +1,6 @@

## 1.0.0
- Don't attach Modernizr to window anymore
- Allow using a JavaScript file for configuration
## 0.0.5

@@ -2,0 +7,0 @@

4

index.js

@@ -10,3 +10,3 @@ "use strict";

"module.exports = window.Modernizr;\n" +
"})(window);";
"})({});";
}

@@ -21,5 +21,5 @@

modernizr.build(JSON.parse(config), function (output) {
modernizr.build(this.exec(config, this.resource), function (output) {
cb(null, wrapOutput(output));
});
};
{
"name": "modernizr-loader",
"version": "0.0.5",
"version": "1.0.0",
"description": "use modernizr with webpack easily",
"main": "index.js",
"scripts": {
"test": "npm test"
"test": "ava"
},

@@ -20,4 +20,10 @@ "keywords": [

"devDependencies": {
"eslint": "^1.9.0",
"eslint-config-peerigon": "^0.1.1"
"ava": "^0.16.0",
"eslint": "^3.3.1",
"eslint-config-peerigon": "^6.0.0",
"eslint-plugin-jsdoc": "^2.3.1",
"json-loader": "^0.5.4",
"modernizr": "^3.3.1",
"temp": "^0.8.3",
"webpack": "^1.13.2"
},

@@ -24,0 +30,0 @@ "repository": {

# modernizr-loader for webpack
[![Build Status](https://travis-ci.org/peerigon/modernizr-loader.svg)](https://travis-ci.org/peerigon/modernizr-loader) [![devDependency Status](https://david-dm.org/peerigon/modernizr-loader/dev-status.svg)](https://david-dm.org/peerigon/modernizr-loader#info=devDependencies) [![peerDependency Status](https://david-dm.org/peerigon/modernizr-loader/peer-status.svg)](https://david-dm.org/peerigon/modernizr-loader#info=peerDependencies)
## Installation
```
$ npm install --save modernizr-loader
$ npm install --save-dev modernizr modernizr-loader
```
## Usage
## Initialization
[Documentation: Using loaders](http://webpack.github.io/docs/using-loaders.html)
You have to create a `.modernizrrc` configuration file and put your modernizr stuff in it. Like so

@@ -26,22 +26,10 @@

Now you are able to require this `.modernizrrc` and get your built modernizr bundled with webpack.
Full list of supported **"options"** and **"feature-detects"** can be found in Modernizr [config-all.json](https://github.com/Modernizr/Modernizr/blob/master/lib/config-all.json).
```javascript
require("!modernizr!./.modernizrrc")
// => returns compiled modernizr build based on your configuration
```
### Webpack config
You are also able to import Modernizr as a module throughout your application like so:
[Documentation: Using loaders](http://webpack.github.io/docs/using-loaders.html)
```javscript
import Modernizr from 'modernizr';
Put the following code to your webpack config file:
if (!Modernizr.promises) {
// ...
}
```
### webpack config
```javascript

@@ -52,4 +40,8 @@ module.exports = {

{
test: /\.modernizrrc$/,
test: /\.modernizrrc.js$/,
loader: "modernizr"
},
{
test: /\.modernizrrc(\.json)?$/,
loader: "modernizr!json"
}

@@ -66,2 +58,14 @@ ]

### Usage
Now you are able to import your custom Modernizr build as a module throughout your application like so:
```javscript
import Modernizr from 'modernizr';
if (!Modernizr.promises) {
// ...
}
```
See the [Modernizr documentation](https://modernizr.com/docs) for all available options.

@@ -71,2 +75,2 @@

Don't hesitate to create a pull request. Every contribution is appreciated. In development you can start the tests by calling `npm test`.
Don't hesitate to create a pull request. Every contribution is appreciated.
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc