Skip to content

Commit f4da756

Browse files
wagnermacielclydin
authored andcommitted
fix(@angular/cli): change wrapping of schematic code
(cherry picked from commit 4b07aa3)
1 parent 7b4e9d4 commit f4da756

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

packages/angular/cli/models/schematic-engine-host.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,9 @@ function wrap(
178178
const schematicCode = readFileSync(schematicFile, 'utf8');
179179
// `module` is required due to @angular/localize ng-add being in UMD format
180180
const headerCode = '(function() {\nvar exports = {};\nvar module = { exports };\n';
181-
const footerCode = exportName ? `\nreturn exports['${exportName}'];});` : '\nreturn exports;});';
181+
const footerCode = exportName
182+
? `\nreturn module.exports['${exportName}'];});`
183+
: '\nreturn module.exports;});';
182184

183185
const script = new Script(headerCode + schematicCode + footerCode, {
184186
filename: schematicFile,

0 commit comments

Comments
 (0)