summaryrefslogtreecommitdiff
path: root/packages/astro/src
diff options
context:
space:
mode:
Diffstat (limited to 'packages/astro/src')
-rw-r--r--packages/astro/src/ast.ts1
-rw-r--r--packages/astro/src/build.ts3
-rw-r--r--packages/astro/src/build/sitemap.ts2
-rw-r--r--packages/astro/src/cli.ts1
-rw-r--r--packages/astro/src/compiler/codegen/index.ts4
-rw-r--r--packages/astro/src/compiler/index.ts1
-rw-r--r--packages/astro/src/config.ts2
-rw-r--r--packages/astro/src/dev.ts3
-rw-r--r--packages/astro/src/logger.ts1
-rw-r--r--packages/astro/src/runtime.ts9
-rw-r--r--packages/astro/src/search.ts2
11 files changed, 10 insertions, 19 deletions
diff --git a/packages/astro/src/ast.ts b/packages/astro/src/ast.ts
index 4de7a6d16..bf73c8508 100644
--- a/packages/astro/src/ast.ts
+++ b/packages/astro/src/ast.ts
@@ -1,4 +1,3 @@
-import 'source-map-support/register.js';
import type { Attribute } from '@astrojs/parser';
// AST utility functions
diff --git a/packages/astro/src/build.ts b/packages/astro/src/build.ts
index c5aac23c7..be7b0219b 100644
--- a/packages/astro/src/build.ts
+++ b/packages/astro/src/build.ts
@@ -1,4 +1,3 @@
-import 'source-map-support/register.js';
import type { AstroConfig, BundleMap, BuildOutput, RuntimeMode, PageDependencies } from './@types/astro';
import type { LogOptions } from './logger';
@@ -13,7 +12,7 @@ import { bold, green, yellow, red, dim, underline } from 'kleur/colors';
import mime from 'mime';
import glob from 'tiny-glob';
import { bundleCSS } from './build/bundle/css.js';
-import { bundleJS, collectJSImports } from './build/bundle/js';
+import { bundleJS, collectJSImports } from './build/bundle/js.js';
import { buildCollectionPage, buildStaticPage, getPageType } from './build/page.js';
import { generateSitemap } from './build/sitemap.js';
import { logURLStats, collectBundleStats, mapBundleStatsToURLStats } from './build/stats.js';
diff --git a/packages/astro/src/build/sitemap.ts b/packages/astro/src/build/sitemap.ts
index 7d6bf62a8..bca69dd8a 100644
--- a/packages/astro/src/build/sitemap.ts
+++ b/packages/astro/src/build/sitemap.ts
@@ -1,6 +1,6 @@
import type { BuildOutput } from '../@types/astro';
-import { canonicalURL } from './util';
+import { canonicalURL } from './util.js';
/** Construct sitemap.xml given a set of URLs */
export function generateSitemap(buildState: BuildOutput, site: string): string {
diff --git a/packages/astro/src/cli.ts b/packages/astro/src/cli.ts
index 65d55c120..6c33f3106 100644
--- a/packages/astro/src/cli.ts
+++ b/packages/astro/src/cli.ts
@@ -1,4 +1,3 @@
-import 'source-map-support/register.js';
/* eslint-disable no-console */
import type { AstroConfig } from './@types/astro';
diff --git a/packages/astro/src/compiler/codegen/index.ts b/packages/astro/src/compiler/codegen/index.ts
index 79d8049fa..7f027b85c 100644
--- a/packages/astro/src/compiler/codegen/index.ts
+++ b/packages/astro/src/compiler/codegen/index.ts
@@ -3,11 +3,10 @@ import type { CompileOptions } from '../../@types/compiler';
import type { AstroConfig, AstroMarkdownOptions, TransformResult, ComponentInfo, Components } from '../../@types/astro';
import type { ImportDeclaration, ExportNamedDeclaration, VariableDeclarator, Identifier, ImportDefaultSpecifier } from '@babel/types';
-import 'source-map-support/register.js';
import eslexer from 'es-module-lexer';
import esbuild from 'esbuild';
import path from 'path';
-import { parse, FEATURE_CUSTOM_ELEMENT } from '@astrojs/parser';
+import astroParser from '@astrojs/parser';
import { walk, asyncWalk } from 'estree-walker';
import _babelGenerator from '@babel/generator';
import babelParser from '@babel/parser';
@@ -26,6 +25,7 @@ import { nodeBuiltinsSet } from '../../node_builtins.js';
import { readFileSync } from 'fs';
import { pathToFileURL } from 'url';
+const { parse, FEATURE_CUSTOM_ELEMENT } = astroParser;
const traverse: typeof babelTraverse.default = (babelTraverse.default as any).default;
// @ts-ignore
diff --git a/packages/astro/src/compiler/index.ts b/packages/astro/src/compiler/index.ts
index 5f295e044..5af082914 100644
--- a/packages/astro/src/compiler/index.ts
+++ b/packages/astro/src/compiler/index.ts
@@ -1,4 +1,3 @@
-import 'source-map-support/register.js';
import type { CompileResult, TransformResult } from '../@types/astro';
import type { CompileOptions } from '../@types/compiler.js';
diff --git a/packages/astro/src/config.ts b/packages/astro/src/config.ts
index f4315aff6..a1e5556a4 100644
--- a/packages/astro/src/config.ts
+++ b/packages/astro/src/config.ts
@@ -1,6 +1,4 @@
import type { AstroConfig } from './@types/astro';
-
-import 'source-map-support/register.js';
import path from 'path';
import { existsSync } from 'fs';
diff --git a/packages/astro/src/dev.ts b/packages/astro/src/dev.ts
index f6a765ba4..f85d4dda1 100644
--- a/packages/astro/src/dev.ts
+++ b/packages/astro/src/dev.ts
@@ -1,4 +1,3 @@
-import 'source-map-support/register.js';
import type { AstroConfig } from './@types/astro';
import type { LogOptions } from './logger.js';
@@ -8,7 +7,7 @@ import path from 'path';
import { performance } from 'perf_hooks';
import { defaultLogDestination, defaultLogLevel, debug, error, info, parseError } from './logger.js';
import { createRuntime } from './runtime.js';
-import { stopTimer } from './build/util';
+import { stopTimer } from './build/util.js';
const hostname = '127.0.0.1';
diff --git a/packages/astro/src/logger.ts b/packages/astro/src/logger.ts
index 88f591b4d..7ded0696f 100644
--- a/packages/astro/src/logger.ts
+++ b/packages/astro/src/logger.ts
@@ -1,4 +1,3 @@
-import 'source-map-support/register.js';
import type { CompileError } from '@astrojs/parser';
import { bold, blue, red, grey, underline, yellow } from 'kleur/colors';
import { Writable } from 'stream';
diff --git a/packages/astro/src/runtime.ts b/packages/astro/src/runtime.ts
index 52601216a..545c2f7b7 100644
--- a/packages/astro/src/runtime.ts
+++ b/packages/astro/src/runtime.ts
@@ -1,6 +1,6 @@
-import 'source-map-support/register.js';
import type { LogOptions } from './logger';
import type { AstroConfig, CollectionResult, CollectionRSS, CreateCollection, Params, RuntimeMode } from './@types/astro';
+import type { CompileError as ICompileError } from '@astrojs/parser';
import resolve from 'resolve';
import { existsSync, promises as fs } from 'fs';
@@ -16,7 +16,8 @@ import {
SnowpackConfig,
startServer as startSnowpackServer,
} from 'snowpack';
-import { CompileError } from '@astrojs/parser';
+import parser from '@astrojs/parser';
+const { CompileError } = parser;
import { canonicalURL, getSrcPath, stopTimer } from './build/util.js';
import { debug, info } from './logger.js';
import { configureSnowpackLogger } from './snowpack-logger.js';
@@ -49,9 +50,9 @@ type LoadResultSuccess = {
type LoadResultNotFound = { statusCode: 404; error: Error; collectionInfo?: CollectionInfo };
type LoadResultRedirect = { statusCode: 301 | 302; location: string; collectionInfo?: CollectionInfo };
type LoadResultError = { statusCode: 500 } & (
- | { type: 'parse-error'; error: CompileError }
+ | { type: 'parse-error'; error: ICompileError }
| { type: 'ssr'; error: Error }
- | { type: 'not-found'; error: CompileError }
+ | { type: 'not-found'; error: ICompileError }
| { type: 'unknown'; error: Error }
);
diff --git a/packages/astro/src/search.ts b/packages/astro/src/search.ts
index c9f4f436b..5e15d2817 100644
--- a/packages/astro/src/search.ts
+++ b/packages/astro/src/search.ts
@@ -1,6 +1,4 @@
import type { AstroConfig } from './@types/astro';
-
-import 'source-map-support/register.js';
import { existsSync } from 'fs';
import path from 'path';
import { fileURLToPath } from 'url';