summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Drew Powers <1369770+drwpow@users.noreply.github.com> 2021-04-30 10:35:20 -0600
committerGravatar GitHub <noreply@github.com> 2021-04-30 10:35:20 -0600
commitf39a91e6ecbcf5c3c2f431fa8dfc3fbc9a71d89a (patch)
tree9ccc7a538aa3dd32369c80db81c0dac7d9ceab43 /src
parenta79c63750f63eee9e8d32ba156c78a71b25dda12 (diff)
downloadastro-f39a91e6ecbcf5c3c2f431fa8dfc3fbc9a71d89a.tar.gz
astro-f39a91e6ecbcf5c3c2f431fa8dfc3fbc9a71d89a.tar.zst
astro-f39a91e6ecbcf5c3c2f431fa8dfc3fbc9a71d89a.zip
Add portfolio example (#140)
* Add portfolio example * Feedback
Diffstat (limited to 'src')
-rw-r--r--src/compiler/codegen/index.ts8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/compiler/codegen/index.ts b/src/compiler/codegen/index.ts
index 73c038de1..5113799d6 100644
--- a/src/compiler/codegen/index.ts
+++ b/src/compiler/codegen/index.ts
@@ -9,7 +9,7 @@ import path from 'path';
import { walk } from 'estree-walker';
import _babelGenerator from '@babel/generator';
import babelParser from '@babel/parser';
-import { codeFrameColumns } from "@babel/code-frame";
+import { codeFrameColumns } from '@babel/code-frame';
import * as babelTraverse from '@babel/traverse';
import { ImportDeclaration, ExportNamedDeclaration, VariableDeclarator, Identifier } from '@babel/types';
import { warn } from '../../logger.js';
@@ -149,7 +149,7 @@ function getComponentWrapper(_name: string, { type, plugin, url }: ComponentInfo
const currFileUrl = new URL(`file://${filename}`);
if (!plugin) {
- throw new Error(`No supported plugin found for extension ${type}`);
+ throw new Error(`No supported plugin found for ${type ? `extension ${type}` : `${url} (try adding an extension)`}`);
}
const getComponentUrl = (ext = '.js') => {
@@ -327,8 +327,8 @@ function compileModule(module: Script, state: CodegenState, compileOptions: Comp
};
let parseResult;
try {
- parseResult = babelParser.parse(module.content, parseOptions)
- } catch(err) {
+ parseResult = babelParser.parse(module.content, parseOptions);
+ } catch (err) {
const location = { start: err.loc };
const frame = codeFrameColumns(module.content, location);
err.frame = frame;