@danielx/civet 0.9.3 → 0.9.4
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/CHANGELOG.md +11 -0
- package/dist/browser.js +573 -353
- package/dist/civet +1 -1
- package/dist/esm.mjs +11 -5
- package/dist/main.js +838 -541
- package/dist/main.mjs +838 -541
- package/dist/node-worker.mjs +7 -2
- package/dist/types.d.ts +7 -6
- package/dist/unplugin/unplugin.js +2 -2
- package/dist/unplugin/unplugin.mjs +2 -2
- package/package.json +1 -1
package/dist/civet
CHANGED
|
@@ -415,7 +415,7 @@ ${" ".repeat(error.column - 1)}^ ${error.header}`);
|
|
|
415
415
|
}
|
|
416
416
|
if (errors.length) {
|
|
417
417
|
errors = [];
|
|
418
|
-
(0, import_main.generate)(ast, { ...options, errors, sourceMap:
|
|
418
|
+
(0, import_main.generate)(ast, { ...options, errors, sourceMap: new import_main.SourceMap(input) });
|
|
419
419
|
showError(errors[0]);
|
|
420
420
|
return callback(null, void 0);
|
|
421
421
|
}
|
package/dist/esm.mjs
CHANGED
|
@@ -20,11 +20,17 @@ async function load(url, context, next) {
|
|
|
20
20
|
if (context.format === "civet") {
|
|
21
21
|
const path = fileURLToPath(url);
|
|
22
22
|
const source = readFileSync(path, "utf8");
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
23
|
+
let tsSource, sourceMap;
|
|
24
|
+
try {
|
|
25
|
+
({ code: tsSource, sourceMap } = await compile(source, {
|
|
26
|
+
filename: path,
|
|
27
|
+
sourceMap: true,
|
|
28
|
+
js: true
|
|
29
|
+
}));
|
|
30
|
+
} catch (e) {
|
|
31
|
+
console.error(`Civet failed to compile ${url}:`, e);
|
|
32
|
+
throw e;
|
|
33
|
+
}
|
|
28
34
|
const transpiledUrl = url + ".tsx";
|
|
29
35
|
const result = await next(transpiledUrl, {
|
|
30
36
|
// ts-node won't transpile unless this is module
|