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",
"jquery": "2.2.1"
}
I have a vendor webpack config that has the following:
entry: {
vendor: [
'bootstrap',
'bootstrap/dist/css/bootstrap.css',
'breeze-client',
'es6-promise-promise',
'jquery'
]
},
plugins: [
new webpack.ProvidePlugin({
$: 'jquery',
jQuery: 'jquery',
Promise: 'es6-promise-promise',
Q: "q"
})
]
I was getting
Error: Q is undefined. Are you missing Q.js? See https://github.com/kriskowal/q
So I added a polyfill to my code to use ES6 Promises for Q, and do this in my startup code:
import { config } from 'breeze-client'
import { Q } from './lib/my-q-implementation';
config.setQ(Q)
Now I get this:
Unable to locate jQuery
I'm pretty sure boostrap looks for a global jQuery, so I think the problem is breeze.
Why is breeze not seeing the global jQuery? How do I fix this?