Comments (3)
After facing the same kind of issue with the fullcalendar jQuery plugin, banging my head to the wall for few seconds and I found a way to load jQuery plugins using the script-loader
and the expose-loader
!
The fullcalendar plugin uses jQuery
and moment
so I had to expose them as global :
environment.loaders.append('jquery', {
test: require.resolve('jquery'),
use: [
{
loader: 'expose-loader',
options: 'jQuery'
},
{
loader: 'expose-loader',
options: '$'
}
]
})
environment.loaders.append('moment', {
test: require.resolve('moment'),
use: [
{
loader: 'expose-loader',
options: 'moment'
}
]
})
And then I can load fullcalendar this way :
environment.loaders.append('fullcalendar', {
test: require.resolve('fullcalendar'),
loader: 'script-loader?fullcalendar/dist/fullcalendar.js'
})
So I did the same with jquery-minicolors :
environment.loaders.append('jquery-minicolors', {
test: require.resolve('jquery-minicolors'),
loader: 'script-loader?jquery-minicolors/jquery.minicolors.js'
})
And It works 🎉.
from jquery-minicolors.
I don't usually use jQuery with a module loader, but perhaps the suggestions in this answer will point you in the right direction.
Another thing that may (or may not) help is aliasing window.jQuery
like I've seen in a number of Bootstrap projects.
new webpack.ProvidePlugin({
$: 'jquery',
jQuery: 'jquery',
'window.jQuery': 'jquery'
})
Aside from that, I'm not sure as it could be an Angular thing, a Webpack thing, or simply an error in your code. Try logging the value of $
or jQuery
where you instantiate and see if they're actually references to jQuery.
from jquery-minicolors.
Thank you @claviska for your quick response.
I tried everything from the SO question you shared but it didn't worked.
I also tried the alias you gave, but still not working.
From the Chrome console I can access $
and I'm using the fullcalendar package which depends on jQuery so I think jQuery is well configured.
from jquery-minicolors.
Related Issues (20)
- Position failed HOT 1
- The position of the picker does not work correctly when the scale value of the body tag is changed. HOT 1
- Request: beforeShow event
- Performance bugs HOT 3
- displaying HEX code in the color picker panel itself HOT 2
- getting a checked image when selecting a preset swatch HOT 4
- Problem with opacity + wheel HOT 1
- Option to show text input with `inline` option? HOT 1
- Scrolling on mobile HOT 5
- jQuery 4 deprecation warnings
- Any chance of updating this to HDR colours? HOT 1
- Updating settings with shorter array of swatches causes exception
- Initial selection is black HOT 1
- Update github website URL HOT 1
- Use 'Transparent' on swatches HOT 3
- Worst documentation I've even seen ! HOT 1
- bootstrap 5 theme & input-group
- Dynamically add mincolors to a field HOT 1
- Duplicated values in the swatch result in multiple same colors in the swatch HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jquery-minicolors.