✨ improve: js boilerplate
This commit is contained in:
@@ -1,21 +1,13 @@
|
||||
import {domReady} from '@roots/sage/client';
|
||||
import { domReady } from '@roots/sage/client';
|
||||
|
||||
/**
|
||||
* app.main
|
||||
* Application entrypoint
|
||||
*/
|
||||
const main = async (err) => {
|
||||
if (err) {
|
||||
// handle hmr errors
|
||||
console.error(err);
|
||||
}
|
||||
|
||||
// application code
|
||||
};
|
||||
domReady(async () => {
|
||||
// ...
|
||||
});
|
||||
|
||||
/**
|
||||
* Initialize
|
||||
*
|
||||
* @see https://webpack.js.org/api/hot-module-replacement
|
||||
* @see {@link https://webpack.js.org/api/hot-module-replacement/}
|
||||
*/
|
||||
domReady(main);
|
||||
import.meta.webpackHot?.accept(main);
|
||||
import.meta.webpackHot?.accept(console.error);
|
||||
|
||||
Reference in New Issue
Block a user