Skip to content

Commit

Permalink
Support vite.js 5
Browse files Browse the repository at this point in the history
  • Loading branch information
vinkla committed Nov 17, 2023
1 parent cb358b7 commit 6ce16c9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions public/themes/wordplate/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

// Register scripts and styles.
add_action('wp_enqueue_scripts', function () {
$manifestPath = get_theme_file_path('assets/manifest.json');
$manifestPath = get_theme_file_path('assets/.vite/manifest.json');

if (
wp_get_environment_type() === 'local' &&
Expand All @@ -28,7 +28,7 @@
} elseif (file_exists($manifestPath)) {
$manifest = json_decode(file_get_contents($manifestPath), true);
wp_enqueue_script('wordplate', get_theme_file_uri('assets/' . $manifest['resources/js/index.js']['file']));
wp_enqueue_style('wordplate', get_theme_file_uri('assets/' . $manifest['resources/js/index.css']['file']));
wp_enqueue_style('wordplate', get_theme_file_uri('assets/' . $manifest['resources/js/index.js']['css'][0]));
}
});

Expand Down

0 comments on commit 6ce16c9

Please sign in to comment.