Questions tagged [webpack-provide-plugin]

webpack plugin to load modules like jquery into browser without importing them with require or import statements

Usage:

new webpack.ProvidePlugin({ $: 'jquery', jQuery: 'jquery' });

Often questions: 1) migration between webpack versions; 2) compatibility with other methods to achieve the same; 3) multiple times loaded modules.

4 questions
4
votes
2 answers

jQuery not available as "$" when using webpack's ProvidePlugin

I am attempting to use jQuery as $ in my webpack application's entry index.js file, and I am receiving this error when running my application in the browser: Uncaught TypeError: Cannot read property 'fn' of undefined This is due to a line in a…
Matt
  • 23,363
  • 39
  • 111
  • 152
2
votes
1 answer

webpack ProvidePlugin doesn't work for breeze

I am trying to use breeze with a TypeScript web application that uses webpack (4.20.2). These entries are in my npm package.json file: "dependencies": { "bootstrap": "3.3.6", "breeze-client": "1.7.1", "es6-promise-promise": "1.0.0", …
user210757
  • 6,996
  • 17
  • 66
  • 115
0
votes
1 answer

Choose for which files to provide the selection module webpack.ProvidePlugin

Is it possible that in my config I have chosen to serve the react package for specific files with the .jsx extension. Now I have react imported for both .js and .jsx, but can I restrict it only for .jsx files new webpack.ProvidePlugin({ "React":…
arma73
  • 98
  • 7
0
votes
1 answer

Parcel: How to make `React` global instead of importing it in every file

I have found out how to make React global using webpack: https://stackoverflow.com/a/32556581/565877 But I am wondering how to make it global for Parcel
Devin Rhode
  • 23,026
  • 8
  • 58
  • 72