<% if (!moduleOnly) { %>import { <%= pName %>Config } from "./<%= hName %>.config";
import { <%= pName %>Controller } from "./<%= hName %>.controller";

<% } %>let module = angular
    .module("<%= appName %>.<%= name %>", [])<% if (!moduleOnly) { %>
    .controller("<%= pName %>Controller", <%= pName %>Controller)
    .config(<%= pName %>Config)<% } %>;

let <%= name %> = module.name;

export { <%= name %> };
import { <%= pName %>Config } from "./<%= hName %>.config";
import { <%= pName %>Controller } from "./<%= hName %>.controller";

let module = angular
    .module("<%= appName %>.<%= name %>", [])
    .controller("<%= pName %>Controller", <%= pName %>Controller)
    .config(<%= pName %>Config);

let <%= name %> = module.name;

export { <%= name %> };
--- 
+++ 
@@ -1,10 +1,10 @@
-import { <%= pName %>Config } from "./<%= hName %>.config";
+<% if (!moduleOnly) { %>import { <%= pName %>Config } from "./<%= hName %>.config";
 import { <%= pName %>Controller } from "./<%= hName %>.controller";
 
-let module = angular
-    .module("<%= appName %>.<%= name %>", [])
+<% } %>let module = angular
+    .module("<%= appName %>.<%= name %>", [])<% if (!moduleOnly) { %>
     .controller("<%= pName %>Controller", <%= pName %>Controller)
-    .config(<%= pName %>Config);
+    .config(<%= pName %>Config)<% } %>;
 
 let <%= name %> = module.name;
 
Edit base module file to include moduleOnly
