only insert config if the layer was correctly generated

Previously the configuration for the layer was inserted even if the layer generation has failed. 
This modification needs https://github.com/ibm-js/requirejs-dplugins/commit/94ff62bda99d1d9cfb523583af2ba9c9f910d3af but since this commit is in the latest release of requirejs-dplugins that shouldn't be a problem.