Questions tagged [imports-loader]
16 questions
4
votes
0 answers
webpack - imports-loader vs ProvidePlugin
Could someone please show me the differences between the two?
I know that the imports-loader will insert a require into the asking module and the ProvidePlugin will make an instance of, say Jquery, if the symbol $ is matched.
But apart from that are…

Tam Nguyen-Nhat
- 65
- 5
3
votes
1 answer
Cannot find module issue with imports-loader when testing with Jest
When I am testing React components using Jest, I get following error for those components using imports-loader.
Cannot find module 'imports-loader?jQuery=jquery!bootstrap/js/tooltip'
Does anyone know how to fix this?

sam
- 2,780
- 1
- 17
- 30
2
votes
1 answer
Using Imports-Loader and Exports-Loader at same time for legacy code
I have 2 legacy JS files, which I do not want to change. For that reason I want to use exports-loader and imports-loader
File B-legacy needs the global var GLOB from File A-legacy
My webpack.config.js results in
rules: [
{ test: /\.ts$/,…

Daniel R
- 1,122
- 8
- 16
2
votes
1 answer
webpack - imports-loader and ProvidePlugin: similar but not the same?
Here is what I have:
a.js
$(() => {
$.x = 42;
console.log('hello from a');
});
b.js
$(() => {
console.log($.x);
console.log('hello from b');
});
index.html