Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not compatible with webpack bundles #20

Open
moso opened this issue May 11, 2017 · 1 comment
Open

Not compatible with webpack bundles #20

moso opened this issue May 11, 2017 · 1 comment

Comments

@moso
Copy link

moso commented May 11, 2017

As a webpack user, I'm unable to use this plugin without hacking the functions.

When using webpack to bundle jQuery and, ie, Bootstrap JS together one has to deregister WordPress's own jQuery and register webpack's manifest.js, vendor.js (which is where jQuery is residing), and app.js (user scripts).

However, this plugin places its front.js above vendor.js which throws an error in the inspector console that jQuery isn't loaded.

Either the plugin must be modified to take this into account and either check if vendor is enqueued instead, force-place itself below other enqueues, or the check for jQuery must be removed (which is sort of counter-productive).

@chesio
Copy link
Contributor

chesio commented Jul 7, 2017

[...] one has to deregister WordPress's own jQuery [...]
[...] this plugin places its front.js above vendor.js which throws an error in the inspector console that jQuery isn't loaded.

This is rather strange, because the plugin enqueues front.js with jQuery as dependency, so if you deregister jQuery properly then front.js should not be enqueued at all...

If you are already deregistering jQuery, why not to deregister plugin's front.js as well and register it with your vendor.js as dependency?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants