Skip to content

Commit 2a0ec96

Browse files
committed
feat(Build): Add global switch window.__patternslib_disable_modernizr to optionally disable modernizr.
While this is convenient to quickly disable modernizr and also splits modernizr out from the main bundle entry file it was necessary for the clone-code pattern to get a clean code example for the whole html tree.
1 parent af69e64 commit 2a0ec96

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/patterns.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
// Import base
66
import "./globals";
77
import registry from "./core/registry";
8-
import "modernizr";
98

109
// Import all used patterns for the bundle to be generated
1110
import "./core/push_kit";
@@ -74,4 +73,12 @@ import "@patternslib/pat-upload";
7473
// Set to ``true`` to include core styles via JavaScript
7574
//window.__patternslib_import_styles = false;
7675

76+
// Include modernizr per default.
77+
// Most of our styles depend on it.
78+
// You might want to disable it for your project by setting:
79+
// window.__patternslib_disable_modernizr = true;
80+
if (!window.__patternslib_disable_modernizr) {
81+
import("modernizr");
82+
}
83+
7784
registry.init();

0 commit comments

Comments
 (0)