@kopanowebapp/gulpfile-plugin
v1.0.4
Published
A gulpfile for plugins for the Kopano WebApp
Downloads
3
Maintainers
Readme
@kopanowebapp/gulpfile-plugin
This package contains a gulpfile that can be used to build plugins for the Kopano WebApp. The gulpfile assumes the following plugin structure:
<yourplugindirectory>/
├── src/
| ├── resources/
| | ├── css/
| | └── images/
| ├── js/
| └── php/
├── node_modules/
├── manifest.xml
├── package.json
└── package-lock.json
Installion
Note: This documentation assumes that you have created a package.json file in your plugin's root directory, and that you have node and npm installed
Install this package in your plugin by running the following command in your plugin's root folder:
npm install --save-dev @kopanowebapp/gulpfile-plugin
After installing the package, you should run
npx gulpfile-plugin init
All the build files should now be available in your package.
Note: This assumes that you have also added eslint-config-kopano-webapp to your dependencies. See https://stash.kopano.io/users/rtoussaint/repos/eslint-config-kopano-webapp/browse for more information.
Building
The plugin can now be build by running npm run dist
in the root directory of your plugin. This will create the plugin in the dist/ directory.
Note: The original manifest.xml file links to the dist/ directory for release and debug versions. However the manifest is copied to the dist/ directory and rewritten. This make it possible to just copy either the complete directory to a 'deployed' Kopano WebApp or the dist/ directory to the plugins directory of your Kopano WebApp installation (and renaming it of course). The latter is preferred, but the first can be useful for development purpose.
Building with make
Running make
in the root directory of your plugin will in its turn run npm run dist
.
Building with Ant
To deploy your plugin in the old fashioned way while with ant (but still using gulp), a build.xml file is created in the root directory of your plugin.
Now running ant deploy
will install the dependencies, run the linters, concatenate and minify the js and css, move everything to the dist/ directory and finally copy the contents of the dist/ directory to the plugins directory of the Kopano WebApp.
Watching
Running npm run watch
will start gulp in watch mode, useful for development.
create-webapp-plugin
We strongly encourage you to not use this package directly but instead bootstrap your plugin by installing @kopanowebapp/create-webapp-plugin.