Skip to content

Commit

Permalink
chore: update
Browse files Browse the repository at this point in the history
  • Loading branch information
antfu committed Feb 24, 2022
1 parent 9cd01e2 commit 980da69
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/core/resolvers/vant.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import type { ComponentResolver, SideEffectsInfo } from '../../types'
import { kebabCase } from '../utils'
import { isSSR, kebabCase } from '../utils'

const isServer = Boolean(process.env.SSR || process.env.SSG || process.env.VITE_SSR || process.env.VITE_SSG)
const moduleType = isServer ? 'lib' : 'es'
const moduleType = isSSR ? 'lib' : 'es'

export interface VantResolverOptions {
/**
Expand All @@ -16,7 +15,7 @@ export interface VantResolverOptions {
function getSideEffects(dirName: string, options: VantResolverOptions): SideEffectsInfo | undefined {
const { importStyle = true } = options

if (!importStyle || isServer)
if (!importStyle || isSSR)
return

if (importStyle === 'less')
Expand Down
2 changes: 2 additions & 0 deletions src/core/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ import type { ComponentInfo, ImportInfo, ResolvedOptions } from '../types'
import type { Context } from './context'
import { DISABLE_COMMENT } from './constants'

export const isSSR = Boolean(process.env.SSR || process.env.SSG || process.env.VITE_SSR || process.env.VITE_SSG)

export interface ResolveComponent {
filename: string
namespace?: string
Expand Down

0 comments on commit 980da69

Please sign in to comment.