
Product
Introducing Socket MCP for Claude Desktop
Add secure dependency scanning to Claude Desktop with Socket MCP, a one-click extension that keeps your coding conversations safe from malicious packages.
webpack-modernizr-loader
Advanced tools
Get your modernizr build bundled with webpack, use modernizr with webpack easily
Get your modernizr build bundled with webpack.
$ npm install webpack-modernizr-loader --save-dev
You have to create a .modernizrrc
(or .modernizrrc.js
) configuration file and put your modernizr stuff in it.
Like so:
// .modernizrrc or .modernizrrc.json
{
"options": [
"setClasses"
],
"feature-detects": [
"test/css/flexbox",
"test/es6/promises",
"test/serviceworker"
]
}
Or
'use strict';
module.exports = {
options: [
"setClasses"
],
"feature-detects": [
"test/css/flexbox",
"test/es6/promises",
"test/serviceworker"
]
};
Full list of supported "options" and their "description" can be found in modernizr.
Put the following code to your webpack config file:
module.exports = {
module: {
loaders: [
{
loader: 'webpack-modernizr?useConfigFile',
test: /\.modernizrrc$/, // or "/\.modernizrrc\.json$/", or "/\.modernizrrc\.js$/"
}
]
},
resolve: {
alias: {
modernizr$: path.resolve(__dirname, "path/to/.modernizrrc") // or "path/to/.modernizrrc.json", or "path/to/.modernizrrc.js"
}
}
}
Alternative configurations supported dynamic configuration:
const modernizrOptions = {
options: [
"setClasses"
],
'feature-detects': [
'test/css/flexbox',
'test/es6/promises',
'test/serviceworker'
]
};
module.exports = {
module: {
loaders: [
{
loader: `webpack-modernizr?${JSON.stringify(modernizrOptions)}`,
test: /modernizr$/
}
]
},
resolve: {
alias: {
modernizr$: path.resolve(__dirname, "path/to/empty-file") // You can add comment "Please do not delete this file" in this file
}
}
}
In webpack 2
your can use this config:
const modernizrOptions = {
options: [
"setClasses"
],
'feature-detects': [
'test/css/flexbox',
'test/es6/promises',
'test/serviceworker'
]
};
module.exports = {
module: {
rules: [
{
loader: `webpack-modernizr-loader`,
options: modernizrOptions,
test: /modernizr$/
}
]
},
resolve: {
alias: {
modernizr$: path.resolve(__dirname, "path/to/empty-file") // You can add comment "Please do not delete this file" in this file
}
}
}
Now you are able to import your custom modernizr build as a module throughout your application like so:
const modernizr = require('modernizr');
import 'modernizr';
You can used bundle plugin for async loading:
import modernizrLoader from 'bundle?lazy!modernizr';
modernizrLoader(() => {});
Feel free to push your code if you agree with publishing under the MIT license.
2.0.0 - 2017-02-01
modernizr
using config
option.useConfigFile
option.encodeURI
for query string
.FAQs
Get your modernizr build bundled with webpack, use modernizr with webpack easily
The npm package webpack-modernizr-loader receives a total of 6,274 weekly downloads. As such, webpack-modernizr-loader popularity was classified as popular.
We found that webpack-modernizr-loader demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
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.
Product
Add secure dependency scanning to Claude Desktop with Socket MCP, a one-click extension that keeps your coding conversations safe from malicious packages.
Product
Socket now supports Scala and Kotlin, bringing AI-powered threat detection to JVM projects with easy manifest generation and fast, accurate scans.
Application Security
/Security News
Socket CEO Feross Aboukhadijeh and a16z partner Joel de la Garza discuss vibe coding, AI-driven software development, and how the rise of LLMs, despite their risks, still points toward a more secure and innovative future.