Skip to content

Commit 4b07aa3

Browse files
wagnermacielclydin
authored andcommitted
fix(@angular/cli): change wrapping of schematic code
1 parent a0e3de2 commit 4b07aa3

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

packages/angular/cli/src/command-builder/utilities/schematic-engine-host.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,9 @@ function wrap(
195195
const schematicCode = readFileSync(schematicFile, 'utf8');
196196
// `module` is required due to @angular/localize ng-add being in UMD format
197197
const headerCode = '(function() {\nvar exports = {};\nvar module = { exports };\n';
198-
const footerCode = exportName ? `\nreturn exports['${exportName}'];});` : '\nreturn exports;});';
198+
const footerCode = exportName
199+
? `\nreturn module.exports['${exportName}'];});`
200+
: '\nreturn module.exports;});';
199201

200202
const script = new Script(headerCode + schematicCode + footerCode, {
201203
filename: schematicFile,

0 commit comments

Comments
 (0)