@@ -1,15 +1,21 @@
|
||||
import {domReady} from '@roots/sage/client';
|
||||
|
||||
/**
|
||||
* Run the application when the DOM is ready.
|
||||
* app.main
|
||||
*/
|
||||
domReady(() => {
|
||||
// Application code.
|
||||
});
|
||||
const main = async (err) => {
|
||||
if (err) {
|
||||
// handle hmr errors
|
||||
console.error(err);
|
||||
}
|
||||
|
||||
// application code
|
||||
};
|
||||
|
||||
/**
|
||||
* Accept module updates
|
||||
* Initialize
|
||||
*
|
||||
* @see https://webpack.js.org/api/hot-module-replacement
|
||||
*/
|
||||
import.meta.webpackHot?.accept(console.error);
|
||||
domReady(main);
|
||||
import.meta.webpackHot?.accept(main);
|
||||
|
||||
@@ -1,22 +1,27 @@
|
||||
import {domReady} from '@roots/sage/client';
|
||||
import {registerBlockStyle, unregisterBlockStyle} from '@wordpress/blocks';
|
||||
|
||||
import {domReady} from '@roots/sage/client';
|
||||
|
||||
/**
|
||||
* Customize block styles
|
||||
* editor.main
|
||||
*/
|
||||
domReady(() => {
|
||||
const main = (err) => {
|
||||
if (err) {
|
||||
// handle hmr errors
|
||||
console.error(err);
|
||||
}
|
||||
|
||||
unregisterBlockStyle('core/button', 'outline');
|
||||
|
||||
registerBlockStyle('core/button', {
|
||||
name: 'outline',
|
||||
label: 'Outline',
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Accept module updates
|
||||
* Initialize
|
||||
*
|
||||
* @see https://webpack.js.org/api/hot-module-replacement
|
||||
*/
|
||||
import.meta.webpackHot?.accept(console.error);
|
||||
domReady(main);
|
||||
import.meta.webpackHot?.accept(main);
|
||||
|
||||
Reference in New Issue
Block a user