UPDATE Update audio player block to use local Plyr assets and add build scripts for asset management
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
47ff454ff0
commit
d62e3ca3b9
File diff suppressed because one or more lines are too long
2
plugins/carhop-blocks/blocks/audio-player/assets/plyr/plyr.min.js
vendored
Normal file
2
plugins/carhop-blocks/blocks/audio-player/assets/plyr/plyr.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
After Width: | Height: | Size: 5.5 KiB |
|
|
@ -19,13 +19,14 @@ if (! defined('ABSPATH')) {
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Register Plyr library assets
|
* Register Plyr library assets
|
||||||
|
* Assets are copied from node_modules to assets/plyr for production deployment
|
||||||
*/
|
*/
|
||||||
function create_block_audio_player_register_plyr()
|
function create_block_audio_player_register_plyr()
|
||||||
{
|
{
|
||||||
// Register Plyr CSS
|
// Register Plyr CSS
|
||||||
wp_register_style(
|
wp_register_style(
|
||||||
'plyr',
|
'plyr',
|
||||||
plugins_url('node_modules/plyr/dist/plyr.css', __FILE__),
|
plugins_url('assets/plyr/plyr.css', __FILE__),
|
||||||
array(),
|
array(),
|
||||||
'3.8.3'
|
'3.8.3'
|
||||||
);
|
);
|
||||||
|
|
@ -33,7 +34,7 @@ function create_block_audio_player_register_plyr()
|
||||||
// Register Plyr JS
|
// Register Plyr JS
|
||||||
wp_register_script(
|
wp_register_script(
|
||||||
'plyr',
|
'plyr',
|
||||||
plugins_url('node_modules/plyr/dist/plyr.min.js', __FILE__),
|
plugins_url('assets/plyr/plyr.min.js', __FILE__),
|
||||||
array(),
|
array(),
|
||||||
'3.8.3',
|
'3.8.3',
|
||||||
true
|
true
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,9 @@
|
||||||
"license": "GPL-2.0-or-later",
|
"license": "GPL-2.0-or-later",
|
||||||
"main": "build/index.js",
|
"main": "build/index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
"copy-plyr": "mkdir -p assets/plyr && cp node_modules/plyr/dist/plyr.min.js assets/plyr/ && cp node_modules/plyr/dist/plyr.css assets/plyr/ && cp node_modules/plyr/dist/plyr.svg assets/plyr/",
|
||||||
|
"prebuild": "pnpm run copy-plyr",
|
||||||
|
"prestart": "pnpm run copy-plyr",
|
||||||
"build": "wp-scripts build --blocks-manifest",
|
"build": "wp-scripts build --blocks-manifest",
|
||||||
"format": "wp-scripts format",
|
"format": "wp-scripts format",
|
||||||
"lint:css": "wp-scripts lint-style",
|
"lint:css": "wp-scripts lint-style",
|
||||||
|
|
@ -21,4 +24,4 @@
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"plyr": "^3.8.3"
|
"plyr": "^3.8.3"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue
Block a user