Dev
Start the NarraLeaf development server.
narraleaf dev starts the local development workflow from the current project root.
narraleaf devWhat It Does
The dev command:
- Parses
package.jsonandnarraleaf.config.js. - Validates the renderer project structure.
- Watches the main-process entry and renderer files.
- Builds development output under the configured
tempdirectory. - Starts Electron.
- Starts a WebSocket server on
dev.port. - Optionally starts an HTTP dev server for renderer output.
Ports
The default dev WebSocket port is 5050.
module.exports = {
dev: {
port: 5050,
},
};When renderer.httpDevServer is enabled, the renderer output is served over HTTP. The default HTTP port is 5051.
module.exports = {
renderer: {
httpDevServer: true,
httpDevServerPort: 5051,
},
};Rebuild Behavior
- Main-process changes ask the running app to quit and restart Electron.
- Renderer changes ask the renderer process to refresh.
- Page changes regenerate the temporary renderer entry before rebuilding.
Stop the dev server with Ctrl+C.