Can somebody elaborate on how to use the stub_modules, please?
How are they specified using generic setups registry.xml?
In case of production (precompiling with grunt) how does the compile process get notice of that stub_modules are used?
Let's assume we have a production bundle containing a mockup pattern that depends on jquery (or any other resource already included in the "plone bundle"):
Bundle spezification:
require([
'jquery', // Is alread present in the Plone bundle
'pat-registry',
'mockup-patterns-inqbus_mailcenter_listview',
...
Pattern definition:
define([
'mockup-patterns-base',
'pat-registry',
'jquery', // here we require jquery
'inqbus_mailcenter_datatables',
'inqbus_mailcenter_datatables_editable'
], function (Base, Registry, $, Datatables, DatatablesEditable) {
'use strict';
These specifications will cause jquery to be compiled into the bundle.
And here comes the final question: How to use stub_modules to prevent the jquery to be compiled into the bundle?
You can also add in stub modules through the resource registry control panel in the bundle settings.
As long as you are using the plone-compile-resources, it'll read what is in the bundle settings and use it appropriately. If you have your own custom Gruntfile, then you can stub out modules like this for instance https://github.com/plone/plone.app.mosaic/blob/master/build.js
Error: ENOENT, no such file or directory
'/home/volker/workspace/mailcenter7/zeocluster/src/inqbus.mailcenter.mockup/s
rc/inqbus/mailcenter/mockup/js/empty.js'
In module tree:
mockup-bundles-inqbus_mailcenter
Warning: RequireJS failed. Use --force to continue.
Aborted due to warnings.
Makefile:50: recipe for target 'bundle' failed
make: *** [bundle] Error 6