Skip to content

Commit

Permalink
Fixed an error with MIME type caused by WP not recognizing .cjs files
Browse files Browse the repository at this point in the history
  • Loading branch information
marekdedic committed May 24, 2024
1 parent f4c7302 commit 3408b2e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
20 changes: 13 additions & 7 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,13 +99,19 @@ gulp.task(
gulp.series('build:deps:composer:scoper', 'build:deps:composer:autoloader')
);

gulp.task('build:deps:npm:imagelightbox', () =>
gulp
.src([
'node_modules/imagelightbox/dist/imagelightbox.css',
'node_modules/imagelightbox/dist/imagelightbox.umd.cjs',
])
.pipe(gulp.dest('dist/bundled/'))
gulp.task(
'build:deps:npm:imagelightbox',
gulp.parallel(
() =>
gulp
.src(['node_modules/imagelightbox/dist/imagelightbox.css'])
.pipe(gulp.dest('dist/bundled/')),
() =>
gulp
.src(['node_modules/imagelightbox/dist/imagelightbox.umd.cjs'])
.pipe(rename('imagelightbox.umd.js'))
.pipe(gulp.dest('dist/bundled/'))
)
);

gulp.task('build:deps:npm:imagesloaded', () =>
Expand Down
2 changes: 1 addition & 1 deletion src/php/frontend/class-shortcode.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public static function init() {

Script_And_Style_Helpers::register_script(
'sgdg_imagelightbox_script',
'bundled/imagelightbox.umd.cjs',
'bundled/imagelightbox.umd.js',

Check warning on line 53 in src/php/frontend/class-shortcode.php

View check run for this annotation

Codecov / codecov/patch

src/php/frontend/class-shortcode.php#L53

Added line #L53 was not covered by tests
array( 'jquery' )
);
Script_And_Style_Helpers::register_style( 'sgdg_imagelightbox_style', 'bundled/imagelightbox.css' );
Expand Down

0 comments on commit 3408b2e

Please sign in to comment.