mirror of
https://github.com/10h30/wp-strava.git
synced 2026-07-11 10:46:19 +09:00
Remove JS image loader for URL
This commit is contained in:
Binary file not shown.
|
After Width: | Height: | Size: 271 KiB |
+1
-2
@@ -9,7 +9,6 @@
|
|||||||
"start": "wp-scripts start"
|
"start": "wp-scripts start"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@wordpress/scripts": "6.1.0",
|
"@wordpress/scripts": "6.1.0"
|
||||||
"url-loader": "^3.0.0"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -215,6 +215,14 @@ class WPStrava {
|
|||||||
filemtime( WPSTRAVA_PLUGIN_DIR . 'build/style.css' )
|
filemtime( WPSTRAVA_PLUGIN_DIR . 'build/style.css' )
|
||||||
);
|
);
|
||||||
|
|
||||||
|
wp_localize_script(
|
||||||
|
'wp-strava-block',
|
||||||
|
'wpStrava',
|
||||||
|
array(
|
||||||
|
'placeholderActivityImg' => WPSTRAVA_PLUGIN_URL . 'images/example-activity.png',
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
foreach ( $blocks as $block_class ) {
|
foreach ( $blocks as $block_class ) {
|
||||||
$block = new $block_class();
|
$block = new $block_class();
|
||||||
$block->register_block();
|
$block->register_block();
|
||||||
|
|||||||
@@ -1,10 +1,18 @@
|
|||||||
|
/* global wp, wpStrava */
|
||||||
import { registerBlockType } from '@wordpress/blocks';
|
import { registerBlockType } from '@wordpress/blocks';
|
||||||
import ActivityImage from './activity.png';
|
|
||||||
|
/**
|
||||||
|
* Localized Data.
|
||||||
|
*/
|
||||||
|
const {
|
||||||
|
placeholderActivityImg,
|
||||||
|
} = wpStrava;
|
||||||
|
|
||||||
|
|
||||||
registerBlockType( 'wp-strava/activity', {
|
registerBlockType( 'wp-strava/activity', {
|
||||||
title: 'Strava Activity',
|
title: 'Strava Activity',
|
||||||
icon: 'chart-line',
|
icon: 'chart-line',
|
||||||
category: 'widgets',
|
category: 'embed',
|
||||||
edit: () => <img className="wp-strava-img" src={ActivityImage} />,
|
edit: () => <img className="wp-strava-img" src={placeholderActivityImg} />,
|
||||||
save: () => <div>Hola, mundo!</div>,
|
save: () => <img className="wp-strava-img" src={placeholderActivityImg} />,
|
||||||
} );
|
} );
|
||||||
|
|||||||
@@ -1,17 +0,0 @@
|
|||||||
const defaultConfig = require("./node_modules/@wordpress/scripts/config/webpack.config");
|
|
||||||
|
|
||||||
module.exports = {
|
|
||||||
...defaultConfig,
|
|
||||||
module: {
|
|
||||||
...defaultConfig.module,
|
|
||||||
rules: [
|
|
||||||
...defaultConfig.module.rules,
|
|
||||||
{
|
|
||||||
test: /\.(png|jpg)$/,
|
|
||||||
use: {
|
|
||||||
loader: "url-loader"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
};
|
|
||||||
Reference in New Issue
Block a user