1
0
mirror of https://github.com/robonen/tools.git synced 2026-03-20 02:44:45 +00:00

feat(packages/platform): add global isClient util and build config

This commit is contained in:
2024-10-15 06:21:12 +07:00
parent 4e798acfdd
commit d415e61ac0
4 changed files with 23 additions and 1 deletions

View File

@@ -0,0 +1,9 @@
import { defineBuildConfig } from 'unbuild';
export default defineBuildConfig({
rollup: {
esbuild: {
// minify: true,
},
},
});

View File

@@ -0,0 +1 @@
export * from './multi';

View File

@@ -17,3 +17,12 @@ export const _global =
: typeof self !== 'undefined'
? self
: undefined;
/**
* @name isClient
* @category Multi
* @description Check if the current environment is the client
*
* @since 0.0.2
*/
export const isClient = typeof window !== 'undefined' && typeof document !== 'undefined';

View File

@@ -1,3 +1,6 @@
{
"extends": "@robonen/tsconfig/tsconfig.json"
"extends": "@robonen/tsconfig/tsconfig.json",
"compilerOptions": {
"lib": ["DOM"]
}
}