You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<p>The imports loader allows you to use modules that depend on specific global variables.<p>
14
+
</div>
4
15
5
16
This is useful for third-party modules that rely on global variables like `$` or `this` being the `window` object. The imports loader can add the necessary `require('whatever')` calls, so those modules work with webpack.
6
17
7
-
## Installation
18
+
<h2align="center">Install</h2>
8
19
9
-
```
20
+
```bash
10
21
npm install imports-loader
11
22
```
12
23
13
-
## Usage
24
+
<h2align="center">Usage</h2>
14
25
15
26
Given you have this file `example.js`
16
27
@@ -66,7 +77,7 @@ module.exports = {
66
77
67
78
[Documentation: Using loaders](http://webpack.github.io/docs/using-loaders.html)
68
79
69
-
## Typical use-cases
80
+
<h2align="center">Typical Use Cases</h2>
70
81
71
82
### jQuery plugins
72
83
@@ -88,6 +99,48 @@ imports-loader?define=>false
88
99
89
100
For further hints on compatibility issues, check out [Shimming Modules](http://webpack.github.io/docs/shimming-modules.html) of the official docs.
90
101
91
-
## License
92
-
93
-
MIT (http://www.opensource.org/licenses/mit-license.php)
0 commit comments