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

Document use with Webpack Encore #3

Open
tacman opened this issue Feb 13, 2019 · 1 comment
Open

Document use with Webpack Encore #3

tacman opened this issue Feb 13, 2019 · 1 comment

Comments

@tacman
Copy link

tacman commented Feb 13, 2019

When I use this with webpack encore, I get an error with $ not being defined, the issue with global jQuery.

There's probably a way to do this, if so, can you document it.

So far, I've installed the bundle, and installed simplemde via yarn

yarn add simplemde

Then in the js file, I've tried

global.$ = global.jQuery = $; // and similar hacks
require('simplemde');

But it still fails when I use the Form Type.

ReferenceError: $ is not defined[Learn More]

I know this is a common issue with Javascript Plugins and Encore. Since this is a Symfony bundle, I was hoping you'd have a solution. Thanks.

@gnat42
Copy link
Contributor

gnat42 commented Feb 15, 2019

Hello,

So I haven't had a need to use encore yet so don't really know the best way to solve it but would add documentation if you could provide some idea of what does end up working. The only resource I found was this:

https://symfony.com/doc/current/frontend/encore/legacy-apps.html

Which seems like you sort of found but perhaps there were issues with or something?

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