The core rule
Browsers don’t execute JSX directly. If you split into .jsx and try to load it,
you’ll get failures that look like CORS or “file cannot be found”.
The fix: compile JSX to normal JS once.
Recommended folder layout
/app
index.html
/src
app.jsx
ui.jsx
engine.jsx
/dist
app.js
ui.js
engine.js
Workflow (simple)
- Edit JSX in
/src - Compile to JS in
/dist - Load only
/dist/*.jsfrom your HTML
Index load pattern (safe)
<!-- index.html --> <script src="dist/ui.js"></script> <script src="dist/engine.js"></script> <script src="dist/app.js"></script>
If you still need a local server
Some APIs (fetching files, modules, audio) behave better over http than file://. Use a tiny local server when needed:
# Python (in your project folder) python -m http.server 8000 # Then open: http://localhost:8000/
Neocities deploy
- Upload the same folder structure.
- Make sure links are relative (no absolute disk paths).
- Test after upload because caching can hide changes.
Win condition
You can now build multi-file apps without bundlers, and they work both locally and on Neocities. That’s “portable lab equipment”.