You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Right now, it is very much possible that a same file remains is under different entry-points for a particular app. Webpack chunk splitting works this way and creates shared chunks to prevent duplicate.
When this is the case, if we were to enqueue two different entry-points with same chunk, it will be enqueued twice.
One way to prevent it is by defining $handle programmatically (thereby remove user access).
It should be based on following:
$appName.
$dir ($source).
$js URL (relative URL like app/main.js, app/common.js).
We can combine three and create a string which should be same regardless of entry-point. wp_enqueue_script and wp_enqueue_style will handle it.
The text was updated successfully, but these errors were encountered:
Right now, it is very much possible that a same file remains is under different entry-points for a particular app. Webpack chunk splitting works this way and creates shared chunks to prevent duplicate.
When this is the case, if we were to enqueue two different entry-points with same chunk, it will be enqueued twice.
One way to prevent it is by defining
$handle
programmatically (thereby remove user access).It should be based on following:
app/main.js
,app/common.js
).We can combine three and create a string which should be same regardless of entry-point.
wp_enqueue_script
andwp_enqueue_style
will handle it.The text was updated successfully, but these errors were encountered: