AppSuite:GruntFAQ: Difference between revisions

From Open-Xchange
No edit summary
 
(5 intermediate revisions by 3 users not shown)
Line 1: Line 1:
<div class="title">FAQ regarding Grunt configuration for App Suite UI plugins</div>
The content on this page has moved to https://documentation.open-xchange.com/


= Building UI plugins =
Note: Open-Xchange is in the process of migrating all its technical documentation to a new and improved documentation system (documentation.open-xchange.com). Please note as the migration takes place more information will be available on the new system and less on this system. Thank you for your understanding during this period of transition.
 
== Some of my files aren't copied. How can I extend a copy sub-task? ==
 
Especially when using external libraries managed with Bower or npm, sometimes the [https://github.com/Open-Xchange-Frontend/shared-grunt-config shared grunt configuration] doesn't contain all cases for files to be copied during the build or dist tasks. Due to the [https://johnyb.github.io/2014/05/10/extending_shared_grunt_configuration.html extensibility] of our shared grunt configuration, it's quite easy to add those missing files. You can hook up into the <tt>build_*</tt> or the <tt>dist_*</tt> copy task and add your custom configuration like this:
 
<syntaxhighlight lang="JavaScript">
'use strict';
 
module.exports = function (grunt) {
    grunt.config.extend('copy', {
        build_custom: {
            files: [{
                expand: true,
                src: ['apps/**/*.in', 'apps/**/manifest.json'],
                dest: 'build/'
            }]
        }
    });
};
</syntaxhighlight>
 
Put this in a file inside the <tt>grunt/tasks</tt> directory and you are done. From now on, all files ending with .in and all manifest.json files are put into the <tt>build/</tt> directory using the same structure as in the <tt>apps/</tt> directory. For more detailed information see [http://gruntjs.com/configuring-tasks#files the grunt documentation on files].
 
= Using development proxy server =
 
== I get an error message 'Port 8337 already in use by another process', what can I do? ==
 
Only one instance of appserver is allowed at a time (this might be subject to change, though). You have multiple options to start developing on that plugin. Number one:
 
# Close all other running instances of appserver and run it exclusively in one project
 
Yes, that was the easy one. However, you might want to serve multiple projects at once. This case would need a little more configuration:
 
# Choose one base UI project
# Edit <tt>grunt/local.conf.json</tt>
# add all build/ directories you want to serve to "prefixes" array
# Run <tt>grunt connect watch</tt> in the base directory
# In all other UI projects you want to develop, only run <tt>grunt watch</tt> without the connect task
 
Appserver will in this case do all the cache busting for you (it uses the timestamp of the "newest" directory in the prefix list) and if you didn't de-activate live-reload, it will work for all projects (the watch task sends livereload events to appserver, which will trigger the reload in the browser).

Latest revision as of 08:57, 15 May 2019

The content on this page has moved to https://documentation.open-xchange.com/

Note: Open-Xchange is in the process of migrating all its technical documentation to a new and improved documentation system (documentation.open-xchange.com). Please note as the migration takes place more information will be available on the new system and less on this system. Thank you for your understanding during this period of transition.