Is there a way to execute the block script if is showed? #23
Unanswered
hylink-carlos-nieto
asked this question in
Q&A
Replies: 1 comment
-
Hi! No, app.js will import the js for all blocks. In my experience, it's normally pretty minimal when using alpine unless you're pulling in third-party libraries. It would be nice to be able to break the js up into chunks and provide each page exactly what it needs, but I'm not sure how I'd make the connection between Webpack and what WP blocks are included on a page. Also, if you're starting a new project, I'd use the |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi @cearls I'm going to use this theme in a new project and have a question about the custom script used in each block. Is there a way that the script only will be added in the app.js if the block is in use? I hope you understand this question.
Regards, Carlos.
Beta Was this translation helpful? Give feedback.
All reactions