We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hello, I can't figure out how to include js file in my symfony 4.4 project. Could you tell me which part of Webpack Encore should I look into?
Thanks.
The text was updated successfully, but these errors were encountered:
Hi,
you need to include this little snippet inside your assets/app.js (the fiel for webpack encore):
assets/app.js
import {GdprPopup} from '@nucleos/gdpr-bundle'; document.addEventListener('DOMContentLoaded', () => { new GdprPopup('.gdprpopup-container'); });
Sorry, something went wrong.
I'm afraid it's not so simple. When I launch yarn encore I get the following error: This dependency was not found:
OK, I was able to include your script successfully by slightly editing your code:
import {GdprPopup} from '../../vendor/nucleos/gdpr-bundle/assets/widget.js';
Thanks. I'm using a local tweak inside my package.json, so I can use the import mention above:
package.json
"dependencies": { "@nucleos/gdpr-bundle": "file:vendor/nucleos/gdpr-bundle" },
I'm thinking about migrating the asset part to symfony-ux, so you have not additional step. But it requires some more time.
No branches or pull requests
Question
Hello, I can't figure out how to include js file in my symfony 4.4 project. Could you tell me which part of Webpack Encore should I look into?
Thanks.
The text was updated successfully, but these errors were encountered: