Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fix types errors #2726

Merged
merged 1 commit into from
Mar 27, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions packages/vite/src/node/plugins/importAnalysis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ export function importAnalysisPlugin(config: ResolvedConfig): Plugin {

const rewriteStart = Date.now()
await init
let imports: ImportSpecifier[] = []
let imports: readonly ImportSpecifier[] = []
try {
imports = parseImports(source)[0]
} catch (e) {
Expand Down Expand Up @@ -310,10 +310,8 @@ export function importAnalysisPlugin(config: ResolvedConfig): Plugin {
const isDynamicImport = dynamicIndex >= 0

// static import or valid string in dynamic import
const isLiteralId = !!specifier

// If resolvable, let's resolve it
if (isLiteralId) {
if (!!specifier) {
patak-dev marked this conversation as resolved.
Show resolved Hide resolved
// skip external / data uri
if (isExternalUrl(specifier) || isDataUrl(specifier)) {
continue
Expand Down
2 changes: 1 addition & 1 deletion packages/vite/src/node/plugins/importAnalysisBuild.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ export function buildImportAnalysisPlugin(config: ResolvedConfig): Plugin {

await init

let imports: ImportSpecifier[] = []
let imports: readonly ImportSpecifier[] = []
try {
imports = parseImports(source)[0]
} catch (e) {
Expand Down