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
+9
View File
@@ -0,0 +1,9 @@
import { defineBuildConfig } from 'unbuild';
export default defineBuildConfig({
rollup: {
esbuild: {
// minify: true,
},
},
});
+1
View File
@@ -0,0 +1 @@
export * from './multi';
@@ -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';
+4 -1
View File
@@ -1,3 +1,6 @@
{
"extends": "@robonen/tsconfig/tsconfig.json"
"extends": "@robonen/tsconfig/tsconfig.json",
"compilerOptions": {
"lib": ["DOM"]
}
}