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

Put jQuery available globally through expose-loader Webpack plugin #1

Conversation

dgdavid
Copy link

@dgdavid dgdavid commented Apr 2, 2018

Hi @backpackerhh

This PR, which was made after read a comment on a similar issue, tries to be a solution for the problem described at StackOverflow.

Hopefully, it is enough to solve it :) avoiding to do weird things like

<%= render file: 'node_modules/jquery/dist/jquery.min.js' %>

😇😇😇

dgdavid added 2 commits April 2, 2018 22:08
To add modules/libraries to global object

More info:
https://github.com/webpack-contrib/expose-loader
Because in many scenarios, such as when a _.js.erb_ file is rendered, is
needed to have it available globally, in order to avoid the `$ is not
defined` error.

More info:
drgullin/icheck#322 (comment)
https://github.com/webpack-contrib/expose-loader#usage
@keymastervn
Copy link

This PR saves me from hell.
My working is related to render a partial layout with remote: true. Since that partial layout had no jQuery loaded so every component got broken...
It took me 2 days before I came here 👍

@dgdavid
Copy link
Author

dgdavid commented Feb 7, 2020

This week I have been doing a Github issues cleanup at work and I think it's a perfect occasion to close this PR too 😜

It does not hurt to keep it open but neither to close it. Anyway, it will be available through the searcher.

@dgdavid dgdavid closed this Feb 7, 2020
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

Successfully merging this pull request may close these issues.

2 participants