This is how easy the setup with vite is
If you need custom runtime settings, just create a file named node-red.settings.ts in the root of your project. IT IS FULLY TYPED!
To start the dev server with the latest node-red runtime, run pnpm vite
If you need a different version, configure nodeRedLauncherOptions.runtime.version with the version you need. For example,
If you need different runtime settings for different environments, configure nodeRedLauncherOptions.runtime.settingsFilepath with the path to a different settings.ts file. When this property isn't set, the plugin tries to use settings located at ./node-red.settings.ts
To build your production distro, run pnpm build.
By default, the following 3 files/dir are always copied to dist:
- LICENSE
- README.md
- examples
Your license is also added to the begining of your index.html
The package.json in the dist folder is automatically generated containing only the dependencies that were actually used by the server-side code. Client-side dependencies are bundled with your distro, and properly broken into smaller chunks.
Soon this plugin and the core library will be packaged. At the moment imports will be @allanoricil/nrg/core and @allanoricil/nrg/vite. However, If the node-red core team (@knolleary, @dceejay, @hardillb)review and let me publish these under the @node-red namespace, then imports will be @node-red/nrg/core and @node-red/nrg/vite, which would look way more professional.
This is the directory structure of an nrg project
.
โโโ client/
โ โโโ assets
โ โโโ components
โ โโโ icons
โ โโโ nodes
โ โโโ public
โ โโโ index.ts
โโโ server/
โ โโโ nodes
โ โโโ schemas
โ โโโ index.ts
โโโ locales/
โ โโโ docs/
โ โ โโโ {node-type}/
โ โ โโโ {en-US|pt-BR|...}.{md|html}
โ โโโ labels/
โ โโโ {node-type}/
โ โโโ {en-US|pt-BR|...}.json
โโโ examples/
โ โโโ 01-example.json
โโโ package.json
โโโ LICENSE
โโโ README.md
โโโ node-red.settings.ts
โโโ vite.config.ts