Skip to content

Commit

Permalink
Fix enqueued styles and scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
wilson1000 committed Mar 1, 2024
1 parent 57afbb8 commit fa9bc08
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions public/app/themes/clarity/inc/enqueue.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

function enqueue_clarity_scripts()
{
define('MOJ_DIST_PATH', get_template_directory_uri() . '/dist');
define('MOJ_DIST_PATH', get_stylesheet_directory_uri() . '/dist');

// CSS
wp_enqueue_style('style', mix_asset('/css/style.css'), array(), null, 'screen');
Expand Down Expand Up @@ -45,15 +45,15 @@ function enqueue_clarity_scripts()
*/
function mix_asset($filename)
{
global $webroot_dir;
/*global $webroot_dir;
$manifest = file_get_contents($webroot_dir . '/app/themes/clarity/dist/mix-manifest.json');
$manifest = json_decode($manifest, true);
if (!isset($manifest[$filename])) {
error_log("Mix asset '$filename' does not exist in manifest.");
}
return MOJ_DIST_PATH . $manifest[$filename];
}*/
return MOJ_DIST_PATH . $filename;
}

/**
Expand Down
10 changes: 5 additions & 5 deletions public/app/themes/clarity/webpack.mix.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
let mix = require('laravel-mix')
let mix = require('laravel-mix');

let stylDeps = {
stylusOptions: {
use: [require('jeet')(), require('rupture')()]
}
};

mix.setPublicPath('./dist/')
mix.setPublicPath('./dist/');

/*******************/
mix.js('src/globals/js/script-loader.js', 'dist/js/main.min.js')
Expand All @@ -19,10 +19,10 @@ mix.js('src/globals/js/script-loader.js', 'dist/js/main.min.js')
.copy('./node_modules/jquery/dist/jquery.min.js', 'dist/js/')
.copy('src/globals/fonts/*', 'dist/fonts/')
.copy('src/globals/images', 'dist/images/')
.options({ processCssUrls: false })
.options({ processCssUrls: false });

if (mix.inProduction()) {
mix.version()
mix.version();
} else {
mix.sourceMaps()
mix.sourceMaps();
}

0 comments on commit fa9bc08

Please sign in to comment.