innetjs 2.0.2 → 2.0.3
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.
- package/bin/innet +9 -2
- package/index.es6.js +8 -1
- package/index.js +8 -1
- package/package.json +1 -1
package/bin/innet
CHANGED
|
@@ -415,13 +415,20 @@ class InnetJS {
|
|
|
415
415
|
watcher.on('event', (e) => __awaiter(this, void 0, void 0, function* () {
|
|
416
416
|
if (e.code == 'ERROR') {
|
|
417
417
|
if (e.error.code === 'UNRESOLVED_IMPORT') {
|
|
418
|
-
const [, importer, file] = e.error.message.match(/^Could not resolve '(.+)' from (.+)$/);
|
|
418
|
+
const [, importer, file] = e.error.message.match(/^Could not resolve '(.+)' from (.+)$/) || [];
|
|
419
419
|
const text = (yield fs__default["default"].readFile(file)).toString();
|
|
420
420
|
const lines = new linesAndColumns.LinesAndColumns(text);
|
|
421
421
|
const { line, column } = lines.locationForIndex(text.indexOf(importer));
|
|
422
422
|
logger__default["default"].end('Bundling', e.error.message);
|
|
423
423
|
console.log(`ERROR in ${file}:${line + 1}:${column + 1}`);
|
|
424
424
|
}
|
|
425
|
+
else if (e.error.code === 'PLUGIN_ERROR' && ['rpt2', 'commonjs'].includes(e.error.plugin)) {
|
|
426
|
+
const [, file, line, column] = e.error.message.match(/^[^(]+(src[^(]+)\((\d+),(\d+)\)/) || [];
|
|
427
|
+
logger__default["default"].end('Bundling', e.error.message);
|
|
428
|
+
if (file) {
|
|
429
|
+
console.log(`ERROR in ${file}:${line}:${column}`);
|
|
430
|
+
}
|
|
431
|
+
}
|
|
425
432
|
else {
|
|
426
433
|
logger__default["default"].end('Bundling', error ? e.error.stack : e.error.message);
|
|
427
434
|
}
|
|
@@ -573,7 +580,7 @@ class InnetJS {
|
|
|
573
580
|
}
|
|
574
581
|
}
|
|
575
582
|
|
|
576
|
-
var version = "2.0.
|
|
583
|
+
var version = "2.0.3";
|
|
577
584
|
|
|
578
585
|
require('dotenv').config();
|
|
579
586
|
const innetJS = new InnetJS();
|
package/index.es6.js
CHANGED
|
@@ -387,13 +387,20 @@ class InnetJS {
|
|
|
387
387
|
watcher.on('event', (e) => __awaiter(this, void 0, void 0, function* () {
|
|
388
388
|
if (e.code == 'ERROR') {
|
|
389
389
|
if (e.error.code === 'UNRESOLVED_IMPORT') {
|
|
390
|
-
const [, importer, file] = e.error.message.match(/^Could not resolve '(.+)' from (.+)$/);
|
|
390
|
+
const [, importer, file] = e.error.message.match(/^Could not resolve '(.+)' from (.+)$/) || [];
|
|
391
391
|
const text = (yield fs.readFile(file)).toString();
|
|
392
392
|
const lines = new LinesAndColumns(text);
|
|
393
393
|
const { line, column } = lines.locationForIndex(text.indexOf(importer));
|
|
394
394
|
logger.end('Bundling', e.error.message);
|
|
395
395
|
console.log(`ERROR in ${file}:${line + 1}:${column + 1}`);
|
|
396
396
|
}
|
|
397
|
+
else if (e.error.code === 'PLUGIN_ERROR' && ['rpt2', 'commonjs'].includes(e.error.plugin)) {
|
|
398
|
+
const [, file, line, column] = e.error.message.match(/^[^(]+(src[^(]+)\((\d+),(\d+)\)/) || [];
|
|
399
|
+
logger.end('Bundling', e.error.message);
|
|
400
|
+
if (file) {
|
|
401
|
+
console.log(`ERROR in ${file}:${line}:${column}`);
|
|
402
|
+
}
|
|
403
|
+
}
|
|
397
404
|
else {
|
|
398
405
|
logger.end('Bundling', error ? e.error.stack : e.error.message);
|
|
399
406
|
}
|
package/index.js
CHANGED
|
@@ -413,13 +413,20 @@ class InnetJS {
|
|
|
413
413
|
watcher.on('event', (e) => __awaiter(this, void 0, void 0, function* () {
|
|
414
414
|
if (e.code == 'ERROR') {
|
|
415
415
|
if (e.error.code === 'UNRESOLVED_IMPORT') {
|
|
416
|
-
const [, importer, file] = e.error.message.match(/^Could not resolve '(.+)' from (.+)$/);
|
|
416
|
+
const [, importer, file] = e.error.message.match(/^Could not resolve '(.+)' from (.+)$/) || [];
|
|
417
417
|
const text = (yield fs__default["default"].readFile(file)).toString();
|
|
418
418
|
const lines = new linesAndColumns.LinesAndColumns(text);
|
|
419
419
|
const { line, column } = lines.locationForIndex(text.indexOf(importer));
|
|
420
420
|
logger__default["default"].end('Bundling', e.error.message);
|
|
421
421
|
console.log(`ERROR in ${file}:${line + 1}:${column + 1}`);
|
|
422
422
|
}
|
|
423
|
+
else if (e.error.code === 'PLUGIN_ERROR' && ['rpt2', 'commonjs'].includes(e.error.plugin)) {
|
|
424
|
+
const [, file, line, column] = e.error.message.match(/^[^(]+(src[^(]+)\((\d+),(\d+)\)/) || [];
|
|
425
|
+
logger__default["default"].end('Bundling', e.error.message);
|
|
426
|
+
if (file) {
|
|
427
|
+
console.log(`ERROR in ${file}:${line}:${column}`);
|
|
428
|
+
}
|
|
429
|
+
}
|
|
423
430
|
else {
|
|
424
431
|
logger__default["default"].end('Bundling', error ? e.error.stack : e.error.message);
|
|
425
432
|
}
|