Skip to content

Commit

Permalink
fix(@angular/cli): change wrapping of schematic code
Browse files Browse the repository at this point in the history
(cherry picked from commit 4b07aa3)
  • Loading branch information
wagnermaciel authored and clydin committed Apr 27, 2022
1 parent 7b4e9d4 commit f4da756
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/angular/cli/models/schematic-engine-host.ts
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,9 @@ function wrap(
const schematicCode = readFileSync(schematicFile, 'utf8');
// `module` is required due to @angular/localize ng-add being in UMD format
const headerCode = '(function() {\nvar exports = {};\nvar module = { exports };\n';
const footerCode = exportName ? `\nreturn exports['${exportName}'];});` : '\nreturn exports;});';
const footerCode = exportName
? `\nreturn module.exports['${exportName}'];});`
: '\nreturn module.exports;});';

const script = new Script(headerCode + schematicCode + footerCode, {
filename: schematicFile,
Expand Down

0 comments on commit f4da756

Please sign in to comment.