Developing third party modules
Javier Escobar edited this page May 31, 2018
·
1 revision
One of the great advantages of web components is that your application may use third party modules, thus reducing development time by reusing code that is proven to work. weldkit uses npm to manage module dependencies, so the first step in developing a module is to initialise it as follows:
mkdir MyModule
cd MyModule
npm init
Weldkit is also needed:
npm install weldkit
The structure of a welkit module is the following:
.
├── dist
│ ├── view
│ │ └── main.html
│ └── service
│ └── CalculatorService.js
├── library
├── src
│ ├── html
│ │ └── main.html
│ ├── less
│ │ └── bootstrap
│ │ └── base.less
│ ├── sass
│ └── jsx
│ └── service
│ └── CalculatorService.jsx
├── node_modules
├── main.js
└── package.json
The dist folder stands for distribution and holds the compiled sources. The src folder stands for source and holds source code that needs to be compiled. Usually the files contained in the src folder are not used directly by the module. The library folder holds third party library files that are not handled by npm.