Directory Structure and Building
The directory structure is fairly self explanatory. However, here it is laid out:
src
The main source code directory. Everything is rooted from this directory.
src/@types
A place to store general Typescript type files.
src/client
The main directory for general functionality.
src/components
Where all your components should be stored. How you organise in here is up to you.
src/events
Store your events and event args here.
src/handlers
Store your handlers in here.
src/models
A place for your application specific Typescript types, application enums
or application models.
src/styles
Store your general stylesheets here.
src/views
A place for your views.
Building
You need to explicity call the build process in order to produce a Javascript script file for your application. The command do this by default is weback
, run from the root directory of your application. This will create a js file inside build/js
which you can then use to attach to CTI, Electron, etc.
Note
The dev command
Ctrl/Cmd + Shift + B
will not produce a file. You need to manually build the file yourself.
If you require a more customised build or output, then you'll need to create a new webpack.config.js
file (named whatever you want) that does what you need it to do. You can then call this by using webpack --config your-new-config.js
All build artefacts are available in the build
directory. When attaching your app to external places (i.e. CTI, Electron) you will generally need to copy the contents of this entire directory, minus the index.html
file.