Skip to content

Commit 40a634d

Browse files
committed
Improve dependency detection
1 parent 5b84ea2 commit 40a634d

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/utils/options.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
import type * as ts from 'typescript'
2+
import type { ExternalModule } from '../components/player/VendorComponents'
23
import {
4+
ExternalStyles,
35
PlaygroundOptions,
46
ResponsivePaneSet,
5-
ExternalStyles,
67
} from '../components/workspace/Workspace'
78
import * as DefaultCode from '../constants/DefaultCode'
8-
import { PaneOptions, PaneShorthand, normalizePane } from './Panes'
9-
import defaultLibs from '../utils/TypeScriptDefaultLibs'
109
import defaultCompilerOptions from '../utils/TypeScriptDefaultConfig'
11-
import type { ExternalModule } from '../components/player/VendorComponents'
10+
import defaultLibs from '../utils/TypeScriptDefaultLibs'
11+
import { PaneOptions, PaneShorthand, normalizePane } from './Panes'
1212
import { extname } from './path'
1313

1414
export interface TypeScriptOptions {
@@ -270,7 +270,7 @@ function findImports(code: string) {
270270
const name = match[1] || match[2]
271271

272272
// Check if this import looks like a module name (and not a relative import)
273-
if (name && name.match(/^[a-zA-Z]/)) {
273+
if (name && (name.startsWith('@') || name.match(/^[a-zA-Z]/))) {
274274
imports.push(name)
275275
}
276276
}

0 commit comments

Comments
 (0)