Skip to content

Commit

Permalink
fix: 🐛 swc compile error parser
Browse files Browse the repository at this point in the history
  • Loading branch information
jsimck committed Mar 14, 2022
1 parent 107ac2d commit 26f9e75
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { StatsError } from 'webpack';
import { RE_VALID_FRAME_FIREFOX } from '../../helpers';
import { RE_FILE_PATH_REGEX, CompileError } from './parserUtils';

const RE_SWC_LINE_NUMBER = /(\d+) \|/;
const RE_SWC_LINE_NUMBER = /(\d+) /;

/**
* https://github.com/swc-project/swc/pull/3946
Expand All @@ -19,7 +19,7 @@ function swcLoaderErrorParser(error: StatsError | Error): CompileError {
// Parse error message
const compileError: CompileError = {
name: 'Syntax error',
message: messageLines[2].replace(/error:/gi, '').trim(),
message: messageLines[2].replace(/×/gi, '').trim(),
column: 1, // swc-loader does not report columns reliably
};

Expand Down
4 changes: 4 additions & 0 deletions utils/benchmark/benchmark.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ cd "$ROOT_DIR"
npx create-ima-app --example=hello ima-app

cd ./ima-app

# TODO IMA@18 remove
npm i -D ajv

npm run build
# Add customized environment configuration
mv server/config/environment.js server/config/environment.orig.js
Expand Down

0 comments on commit 26f9e75

Please sign in to comment.