Last change
on this file since 59329aa was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
1019 bytes
|
Line | |
---|
1 | "use strict";
|
---|
2 | /**
|
---|
3 | * @license
|
---|
4 | * Copyright Google LLC All Rights Reserved.
|
---|
5 | *
|
---|
6 | * Use of this source code is governed by an MIT-style license that can be
|
---|
7 | * found in the LICENSE file at https://angular.io/license
|
---|
8 | */
|
---|
9 | Object.defineProperty(exports, "__esModule", { value: true });
|
---|
10 | const json_file_1 = require("../../utility/json-file");
|
---|
11 | function default_1() {
|
---|
12 | return (tree) => {
|
---|
13 | const file = new json_file_1.JSONFile(tree, 'package.json');
|
---|
14 | const scripts = file.get(['scripts']);
|
---|
15 | if (!scripts || typeof scripts !== 'object') {
|
---|
16 | return;
|
---|
17 | }
|
---|
18 | // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
---|
19 | const updatedScripts = Object.entries(scripts).map(([key, value]) => [
|
---|
20 | key,
|
---|
21 | typeof value === 'string'
|
---|
22 | ? value.replace(/ --prod(?!\w)/g, ' --configuration production')
|
---|
23 | : value,
|
---|
24 | ]);
|
---|
25 | file.modify(['scripts'], Object.fromEntries(updatedScripts));
|
---|
26 | };
|
---|
27 | }
|
---|
28 | exports.default = default_1;
|
---|
Note:
See
TracBrowser
for help on using the repository browser.