create-yeow 0.2.43 → 0.2.44
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/package.json
CHANGED
|
@@ -157,6 +157,7 @@ function startHotReload() {
|
|
|
157
157
|
codeFile: compiled.replace(/\\/g, '/'),
|
|
158
158
|
assetsDir: existsSync(assetsDir) ? assetsDir.replace(/\\/g, '/') : null,
|
|
159
159
|
});
|
|
160
|
+
_consumer = null; // invalidate stale source-map cache
|
|
160
161
|
ok('Hot reload sent via WebSocket');
|
|
161
162
|
}
|
|
162
163
|
} catch (e) {
|
|
@@ -202,7 +203,7 @@ async function printFormattedError(err) {
|
|
|
202
203
|
if (err.context) out += ` ${c.D}context: ${err.context}${c.r}\n`;
|
|
203
204
|
out += ` ${c.Y}${err.message}${c.r}\n`;
|
|
204
205
|
|
|
205
|
-
const consumer =
|
|
206
|
+
const consumer = err.fileName === 'main.js' ? await getSourceMapConsumer() : null;
|
|
206
207
|
if (!consumer) {
|
|
207
208
|
if (err.stack) err.stack.split('\n').slice(0, 5).forEach(l => { out += ` ${c.D} ${l.trim()}${c.r}\n`; });
|
|
208
209
|
console.log(out);
|
|
@@ -213,7 +214,7 @@ async function printFormattedError(err) {
|
|
|
213
214
|
const frames = [];
|
|
214
215
|
if (err.stack) {
|
|
215
216
|
for (const line of err.stack.split('\n')) {
|
|
216
|
-
const m = line.match(/at\s+(?:\S+\s+)?\(
|
|
217
|
+
const m = line.match(/at\s+(?:\S+\s+)?\(?\/main\.js:(\d+):(\d+)\)?/);
|
|
217
218
|
if (m) {
|
|
218
219
|
const orig = consumer.originalPositionFor({ line: parseInt(m[1]), column: parseInt(m[2]) });
|
|
219
220
|
frames.push({ orig, raw: line });
|
|
@@ -259,7 +260,8 @@ async function printFormattedError(err) {
|
|
|
259
260
|
const srcPath = f.orig.source.replace(/^\.\.\/\.\.\//, '');
|
|
260
261
|
out += ` ${c.D} at ${srcPath}:${f.orig.line}:${f.orig.column}${c.r}\n`;
|
|
261
262
|
} else {
|
|
262
|
-
|
|
263
|
+
const internal = f.raw.includes('init.js') || f.raw.includes('unknown.js') ? ' (internal)' : '';
|
|
264
|
+
out += ` ${c.D} ${f.raw}${internal}${c.r}\n`;
|
|
263
265
|
}
|
|
264
266
|
}
|
|
265
267
|
}
|