Reputation: 65
I installed with yarn add appear. But the import with import 'appear';
not working.
Upvotes: 1
Views: 147
Reputation: 909
You could do this:
webpack.config.js:
Encore
.addEntry('app', './assets/js/app.js')
assets/js/app.js:
// could add css here too
require('appear'); // might be necessary to add path like with fontawesome '@fortawesome/fontawesome-free/css/all.css'
twig template css:
{% block stylesheets %}
{{ encore_entry_link_tags('app') }}
{% endblock %}
twig template js:
{% block javascripts %}
{{ encore_entry_script_tags('app') }}
{% endblock %}
Upvotes: 1