Fix: Updates webpack public path based on plugin URL
This commit is contained in:
parent
447a97ba64
commit
2358c23371
|
@ -285,6 +285,7 @@ class Admin {
|
|||
'user_caps' => $user_caps,
|
||||
'user_prefs' => $prefs,
|
||||
'base_url' => $TAINACAN_BASE_URL,
|
||||
'plugin_dir_url' => plugin_dir_url( __DIR__ ),
|
||||
'admin_url' => admin_url(),
|
||||
'theme_items_list_url' => esc_url_raw( get_site_url() ) . '/' . \Tainacan\Theme_Helper::get_instance()->get_items_list_slug(),
|
||||
'theme_collection_list_url' => get_post_type_archive_link( 'tainacan-collection' ),
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
import * as conditioner from 'conditioner-core/conditioner-core.esm';
|
||||
|
||||
// Updates Webpack public path based on plugin folder URL, using variable obtained from server side.
|
||||
__webpack_public_path__ = tainacan_plugin.plugin_dir_url + 'assets/js/';
|
||||
|
||||
// Checks if document is loaded
|
||||
const performWhenDocumentIsLoaded = callback => {
|
||||
if (/comp|inter|loaded/.test(document.readyState))
|
||||
|
|
|
@ -26,7 +26,7 @@ module.exports = {
|
|||
},
|
||||
output: {
|
||||
path: path.resolve(__dirname, './src/assets/js/'),
|
||||
publicPath: './../../../wp-content/plugins/tainacan/assets/js/',
|
||||
publicPath: './wp-content/plugins/tainacan/assets/js/',
|
||||
filename: '[name].js'
|
||||
},
|
||||
module: {
|
||||
|
@ -96,6 +96,6 @@ module.exports = {
|
|||
}),
|
||||
new MomentLocalesPlugin({
|
||||
localesToKeep: ['en', 'en-ca', 'en-nz', 'en-gb', 'es-au', 'es-in', 'pt-br', 'pt', 'es', 'es-us', 'es-do', 'fr', 'fr-ch', 'fr-ca', 'sv'],
|
||||
}),
|
||||
})
|
||||
]
|
||||
};
|
Loading…
Reference in New Issue