vaderjs 2.3.0 → 2.3.1
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/main.js +7 -7
- package/package.json +1 -1
package/main.js
CHANGED
|
@@ -204,7 +204,6 @@ async function copyPublicAssets() {
|
|
|
204
204
|
}
|
|
205
205
|
}
|
|
206
206
|
|
|
207
|
-
|
|
208
207
|
async function buildAppEntrypoints(isDev = false) {
|
|
209
208
|
if (!fsSync.existsSync(APP_DIR)) {
|
|
210
209
|
logger.warn("No '/app' directory found, skipping app entrypoint build.");
|
|
@@ -216,7 +215,7 @@ async function copyPublicAssets() {
|
|
|
216
215
|
await fs.mkdir(DIST_DIR, { recursive: true });
|
|
217
216
|
}
|
|
218
217
|
|
|
219
|
-
const devClientScript = isDev ? `
|
|
218
|
+
const devClientScript = isDev ? `
|
|
220
219
|
<script>
|
|
221
220
|
new WebSocket("ws://" + location.host + "/__hmr").onmessage = (msg) => {
|
|
222
221
|
if (msg.data === "reload") location.reload();
|
|
@@ -231,13 +230,13 @@ async function copyPublicAssets() {
|
|
|
231
230
|
}));
|
|
232
231
|
|
|
233
232
|
for (const { name, path: entryPath } of entries) {
|
|
234
|
-
//
|
|
233
|
+
// Check for the specific case where 'name' could be 'index.js' and prevent duplication
|
|
235
234
|
const outDir = path.join(DIST_DIR, name === 'index' ? '' : name);
|
|
236
|
-
const outJsPath = path.join(outDir,
|
|
237
|
-
|
|
235
|
+
const outJsPath = path.join(outDir, 'index.js'); // Output JavaScript file path
|
|
236
|
+
|
|
238
237
|
// Ensure the output directory exists
|
|
239
238
|
await fs.mkdir(outDir, { recursive: true });
|
|
240
|
-
|
|
239
|
+
|
|
241
240
|
// **FIXED CSS HANDLING**: Find, copy, and correctly link CSS files
|
|
242
241
|
const cssLinks = [];
|
|
243
242
|
const cssContent = await fs.readFile(entryPath, "utf8");
|
|
@@ -273,8 +272,9 @@ async function copyPublicAssets() {
|
|
|
273
272
|
<body>
|
|
274
273
|
<div id="app"></div>
|
|
275
274
|
<script type="module">
|
|
276
|
-
import App from '
|
|
275
|
+
import App from '${name !== 'index' ? name : ''}/index.js';
|
|
277
276
|
import * as Vader from '/src/vader/index.js';
|
|
277
|
+
window.Vader = Vader
|
|
278
278
|
Vader.render(Vader.createElement(App, null), document.getElementById("app"));
|
|
279
279
|
</script>
|
|
280
280
|
${devClientScript}
|