Skip to content

Instantly share code, notes, and snippets.

View hphuocthanh's full-sized avatar
🐟
Hi

Tom Thanh hphuocthanh

🐟
Hi
View GitHub Profile
@FbN
FbN / vite.config.js
Last active April 6, 2025 13:31
vite.config.js node built-in polyfills
// yarn add --dev @esbuild-plugins/node-globals-polyfill
import { NodeGlobalsPolyfillPlugin } from '@esbuild-plugins/node-globals-polyfill'
// yarn add --dev @esbuild-plugins/node-modules-polyfill
import { NodeModulesPolyfillPlugin } from '@esbuild-plugins/node-modules-polyfill'
// You don't need to add this to deps, it's included by @esbuild-plugins/node-modules-polyfill
import rollupNodePolyFill from 'rollup-plugin-node-polyfills'
export default {
resolve: {
alias: {
@sand97
sand97 / _app.js
Last active September 27, 2022 10:12
Example of Nextjs Splash screen _app.js
function MyApp({ Component, pageProps }) {
// Hide splash screen shen we are server side
useEffect(() => {
if (typeof window !== 'undefined') {
const loader = document.getElementById('globalLoader');
if (loader)
loader.style.display = 'none';
}
}, []);