Skip to content

Commit

Permalink
fix(@angular/cli): change wrapping of schematic code
Browse files Browse the repository at this point in the history
  • Loading branch information
wagnermaciel authored and clydin committed Apr 27, 2022
1 parent a0e3de2 commit 4b07aa3
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,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 4b07aa3

Please sign in to comment.