jtsx-loader 0.1.6 → 0.1.7
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/example/pages/index.jsx +1 -1
- package/example/pages/ru.jsx +1 -7
- package/loader/loader.mjs +8 -2
- package/package.json +1 -1
package/example/pages/index.jsx
CHANGED
|
@@ -178,7 +178,7 @@ export default async ({ title }) => <html lang="en">
|
|
|
178
178
|
</section>
|
|
179
179
|
|
|
180
180
|
<section>
|
|
181
|
-
<h2>
|
|
181
|
+
<h2>Project inspired by:</h2>
|
|
182
182
|
<p><a href="https://esbuild.github.io/api/#jsx-factory">https://esbuild.github.io/api/#jsx-factory</a></p>
|
|
183
183
|
<p><a href="https://lwebapp.com/en/post/custom-jsx">https://lwebapp.com/en/post/custom-jsx</a></p>
|
|
184
184
|
<p><a href="https://nakedjsx.org/">https://nakedjsx.org/</a></p>
|
package/example/pages/ru.jsx
CHANGED
|
@@ -179,16 +179,10 @@ export default async ({ title }) => <html lang="ru">
|
|
|
179
179
|
</section>
|
|
180
180
|
|
|
181
181
|
<section>
|
|
182
|
-
<h2
|
|
182
|
+
<h2>Проект вдохновлен следующими работами:</h2>
|
|
183
183
|
<p><a href="https://esbuild.github.io/api/#jsx-factory">https://esbuild.github.io/api/#jsx-factory</a></p>
|
|
184
184
|
<p><a href="https://lwebapp.com/en/post/custom-jsx">https://lwebapp.com/en/post/custom-jsx</a></p>
|
|
185
185
|
<p><a href="https://nakedjsx.org/">https://nakedjsx.org/</a></p>
|
|
186
186
|
</section>
|
|
187
|
-
|
|
188
|
-
{/*
|
|
189
|
-
Inline functions not allowed
|
|
190
|
-
<form action="/api" onSubmit={async () => {
|
|
191
|
-
await console.log('ONSUBMIT');
|
|
192
|
-
}} novalidate></form> */}
|
|
193
187
|
</Layout>
|
|
194
188
|
}
|
package/loader/loader.mjs
CHANGED
|
@@ -4,7 +4,6 @@ import { fileURLToPath, pathToFileURL } from 'node:url';
|
|
|
4
4
|
|
|
5
5
|
import { transformSync } from 'esbuild';
|
|
6
6
|
import { isBuiltin } from 'node:module';
|
|
7
|
-
|
|
8
7
|
// TODO: убрать esm-reload
|
|
9
8
|
// INSPIRED: https://github.com/pygy/esm-reload/tree/main
|
|
10
9
|
let id = 0;
|
|
@@ -75,7 +74,14 @@ export async function load(url, context, nextLoad) {
|
|
|
75
74
|
try {
|
|
76
75
|
transformed = transformSync(source, esbuildTransformConfig);
|
|
77
76
|
} catch (error) {
|
|
78
|
-
|
|
77
|
+
console.error('JTSX TRANSFORM ERROR');
|
|
78
|
+
error.errors.map(err => {
|
|
79
|
+
const errorMessage = `${err.location.lineText}
|
|
80
|
+
${err.text}
|
|
81
|
+
${filePath}:${err.location.line}-${err.location.column}`;
|
|
82
|
+
// console.error('FULL DETAILS', err);
|
|
83
|
+
throw new Error(errorMessage);
|
|
84
|
+
})
|
|
79
85
|
}
|
|
80
86
|
|
|
81
87
|
return {
|