lilact 0.26.14 → 0.26.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -43,6 +43,7 @@ function createLilactJsxPlugin({ mode }) {
43
43
  const out = transpileJSX(source, {
44
44
  path: args.path,
45
45
  appendSourcemap: DEBUG,
46
+ logErrors: true
46
47
  });
47
48
 
48
49
  return { contents: out, loader: "js" };
package/src/errors.jsx CHANGED
@@ -205,8 +205,12 @@ export function traceError(error, run_path)
205
205
  }
206
206
  else {
207
207
  const loc = getErrorLocation(error);
208
- if(error.fileName) obj.fileName = error.fileName;
209
- else if(run_path) obj.fileName = run_path;
208
+
209
+ //if(!obj.fileName) {
210
+ if(error.fileName) obj.fileName = error.fileName;
211
+ else if(run_path) obj.fileName = run_path;
212
+ //}
213
+
210
214
  obj.lineNumber = loc.line;
211
215
  obj.columnNumber = loc.col;
212
216
  }
package/src/jsx.js CHANGED
@@ -976,6 +976,7 @@ export function transpileJSX( jsx, {
976
976
  discardComments = false,
977
977
 
978
978
  produceCJS = false,
979
+ logErrors = false,
979
980
 
980
981
  // lilact internal
981
982
  blocks_info = {
@@ -993,8 +994,9 @@ export function transpileJSX( jsx, {
993
994
 
994
995
  raiseError = ((eols, msg, index)=>{
995
996
  const rc = getRowCol(eols, index);
997
+
996
998
  const er = new Error(msg);
997
- console.error(`JSXParserError: ${msg} [file ${path} at line ${rc[0]+1}]`);
999
+ if(logErrors) console.error(`JSXParserError: ${msg} [file ${path} at line ${rc[0]}]`);
998
1000
  [er.lineNumber, er.columnNumber] = rc;
999
1001
  er.name = 'JSXParseError';
1000
1002
  er.fileName = path;