@c8y/devkit 1020.0.19 → 1020.0.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/webpack/EnvironmentOptions.d.ts +4 -0
- package/dist/src/webpack/EnvironmentOptions.js +18 -1
- package/dist/src/webpack/EnvironmentOptions.js.map +1 -1
- package/dist/src/webpack/config/base.js +11 -3
- package/dist/src/webpack/config/base.js.map +1 -1
- package/dist/src/webpack/config/plugin.d.ts +1 -1
- package/dist/src/webpack/config/plugin.js +4 -2
- package/dist/src/webpack/config/plugin.js.map +1 -1
- package/dist/src/webpack/config/translation.d.ts +10 -2
- package/dist/src/webpack/config/translation.js +29 -2
- package/dist/src/webpack/config/translation.js.map +1 -1
- package/dist/src/webpack/loaders/loader-locales.d.ts +6 -0
- package/dist/src/webpack/loaders/loader-locales.js +22 -0
- package/dist/src/webpack/loaders/loader-locales.js.map +1 -0
- package/dist/src/webpack/loaders/loader-po.js +1 -1
- package/dist/src/webpack/loaders/loader-po.js.map +1 -1
- package/package.json +3 -3
|
@@ -1,8 +1,25 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.WebpackOptions = exports.notRunTimeOptions = void 0;
|
|
3
|
+
exports.DEFAULT_LOCALES = exports.WebpackOptions = exports.notRunTimeOptions = void 0;
|
|
4
4
|
exports.notRunTimeOptions = ['brandingEntry'];
|
|
5
5
|
class WebpackOptions {
|
|
6
6
|
}
|
|
7
7
|
exports.WebpackOptions = WebpackOptions;
|
|
8
|
+
/**
|
|
9
|
+
* The default locales that are used when no different language is defined.
|
|
10
|
+
*/
|
|
11
|
+
exports.DEFAULT_LOCALES = [
|
|
12
|
+
'en-GB',
|
|
13
|
+
'en',
|
|
14
|
+
'ja',
|
|
15
|
+
'es',
|
|
16
|
+
'zh',
|
|
17
|
+
'pt',
|
|
18
|
+
'pl',
|
|
19
|
+
'de',
|
|
20
|
+
'fr',
|
|
21
|
+
'ko',
|
|
22
|
+
'nl',
|
|
23
|
+
'ru'
|
|
24
|
+
];
|
|
8
25
|
//# sourceMappingURL=EnvironmentOptions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EnvironmentOptions.js","sourceRoot":"","sources":["../../../src/webpack/EnvironmentOptions.ts"],"names":[],"mappings":";;;AAKa,QAAA,iBAAiB,GAAG,CAAC,eAAe,CAA2C,CAAC;AA2C7F,MAAa,cAAc;CAiE1B;AAjED,wCAiEC"}
|
|
1
|
+
{"version":3,"file":"EnvironmentOptions.js","sourceRoot":"","sources":["../../../src/webpack/EnvironmentOptions.ts"],"names":[],"mappings":";;;AAKa,QAAA,iBAAiB,GAAG,CAAC,eAAe,CAA2C,CAAC;AA2C7F,MAAa,cAAc;CAiE1B;AAjED,wCAiEC;AAED;;GAEG;AACU,QAAA,eAAe,GAAG;IAC7B,OAAO;IACP,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;CACL,CAAC"}
|
|
@@ -2,18 +2,19 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.webpackConfigurationTransformerWithContextForDevServer = exports.webpackConfigurationTransformerWithContext = void 0;
|
|
4
4
|
const architect_1 = require("@angular-devkit/architect");
|
|
5
|
+
const lodash_1 = require("lodash");
|
|
6
|
+
const path_1 = require("path");
|
|
5
7
|
const webpack_merge_1 = require("webpack-merge");
|
|
6
8
|
const federationUtils_1 = require("../utils/federationUtils");
|
|
7
9
|
const helpers_1 = require("../utils/helpers");
|
|
8
10
|
const babel_1 = require("./babel");
|
|
9
11
|
const development_1 = require("./development");
|
|
12
|
+
const extra_1 = require("./extra");
|
|
10
13
|
const legacy_1 = require("./legacy");
|
|
11
14
|
const plugin_1 = require("./plugin");
|
|
12
15
|
const production_1 = require("./production");
|
|
13
16
|
const styles_1 = require("./styles");
|
|
14
17
|
const translation_1 = require("./translation");
|
|
15
|
-
const lodash_1 = require("lodash");
|
|
16
|
-
const extra_1 = require("./extra");
|
|
17
18
|
/**
|
|
18
19
|
* This file contains functions and configurations used to customize and transform the webpack configuration.
|
|
19
20
|
* used by an Angular project. It includes customizations such as:
|
|
@@ -68,7 +69,7 @@ async function webpackConfigurationTransformer(baseWebpackConfig, browserBuilder
|
|
|
68
69
|
baseWebpackConfig,
|
|
69
70
|
(0, lodash_1.pick)(envOptions.buildTime, 'mode', 'entry')
|
|
70
71
|
]);
|
|
71
|
-
const translationConfig = (0, translation_1.config)();
|
|
72
|
+
const translationConfig = (0, translation_1.config)(envOptions);
|
|
72
73
|
const imagesConfig = (0, helpers_1.buildImagesConfig)();
|
|
73
74
|
const babelConfig = (0, babel_1.config)();
|
|
74
75
|
const pluginConfig = (0, plugin_1.config)(browserBuilderOptions, c8yWebpackConfig, projectRootPath);
|
|
@@ -104,6 +105,13 @@ async function webpackConfigurationTransformer(baseWebpackConfig, browserBuilder
|
|
|
104
105
|
stats: browserBuilderOptions.buildTime?.stats || {
|
|
105
106
|
chunks: false,
|
|
106
107
|
excludeModules: [/locales.angular/]
|
|
108
|
+
},
|
|
109
|
+
// Fix for angular/common package resolution
|
|
110
|
+
// Issue: https://github.com/webpack/webpack/issues/13865
|
|
111
|
+
resolve: {
|
|
112
|
+
alias: {
|
|
113
|
+
'angular-common': (0, path_1.dirname)(require.resolve('@angular/common/package.json'))
|
|
114
|
+
}
|
|
107
115
|
}
|
|
108
116
|
}
|
|
109
117
|
]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base.js","sourceRoot":"","sources":["../../../../src/webpack/config/base.ts"],"names":[],"mappings":";;;AAAA,yDAAmF;
|
|
1
|
+
{"version":3,"file":"base.js","sourceRoot":"","sources":["../../../../src/webpack/config/base.ts"],"names":[],"mappings":";;;AAAA,yDAAmF;AACnF,mCAA8B;AAC9B,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AC;iBAC3E;aACF;SACF;KAC+B,CAAC,CAAC;IAEpC,sCAAsC;IACtC,MAAM,kBAAkB,GAAG,IAAA,wBAAgB,EAAC,UAAU,EAAE,wBAAwB,CAAC,CAAC;IAClF,MAAM,YAAY,GAAyB,IAAA,qBAAY,EAAC;QACtD,wBAAwB;QACxB,kBAAkB;KACnB,CAAC,CAAC;IAEH,IAAI,eAAe,GAAG,uBAAuB;QAC3C,CAAC,CAAC,IAAA,sCAAwB,EAAC,UAAU,EAAE,YAAY,EAAE,uBAAuB,CAAC;QAC7E,CAAC,CAAC,YAAY,CAAC;IAEjB,oEAAoE;IACpE,IAAI,YAAY,CAAC,IAAI,KAAK,YAAY,EAAE,CAAC;QACvC,eAAe,GAAG,IAAA,oCAAuB,EAAC,UAAU,EAAE,eAAe,CAAC,CAAC;IACzE,CAAC;IAED,OAAO,OAAO,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC;AAC1C,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Configuration } from 'webpack';
|
|
2
1
|
import { Path } from '@angular-devkit/core';
|
|
2
|
+
import { Configuration } from 'webpack';
|
|
3
3
|
import { WebpackConfiguration } from 'webpack-dev-server';
|
|
4
4
|
import { C8yBrowserBuilderOptions } from '../../builders/BuilderOptions';
|
|
5
5
|
export declare function config(options: C8yBrowserBuilderOptions, configuration: WebpackConfiguration, projectRootPath: Path): Configuration;
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.config = void 0;
|
|
4
|
+
const core_1 = require("@angular-devkit/core");
|
|
4
5
|
const CopyPlugin = require("copy-webpack-plugin");
|
|
5
6
|
const path_1 = require("path");
|
|
6
7
|
const webpack_1 = require("webpack");
|
|
7
|
-
const
|
|
8
|
+
const BuildDefaults_1 = require("../BuildDefaults");
|
|
8
9
|
const plugin_1 = require("../plugin/plugin");
|
|
9
10
|
const translation_aggregation_plugin_1 = require("../plugin/translation-aggregation-plugin");
|
|
10
11
|
const federation_1 = require("./federation");
|
|
11
|
-
const
|
|
12
|
+
const translation_1 = require("./translation");
|
|
12
13
|
function config(options, configuration, projectRootPath) {
|
|
13
14
|
if (options.index && typeof options.index !== 'string') {
|
|
14
15
|
throw new Error('Only string path to HTML file is supported.');
|
|
@@ -54,6 +55,7 @@ function config(options, configuration, projectRootPath) {
|
|
|
54
55
|
return {
|
|
55
56
|
plugins: [
|
|
56
57
|
new translation_aggregation_plugin_1.TranslationAggregationPlugin(),
|
|
58
|
+
(0, translation_1.getLocalesContextReplacePlugin)(options),
|
|
57
59
|
new webpack_1.DefinePlugin({
|
|
58
60
|
__WEBPACK__: true,
|
|
59
61
|
__MODE__: JSON.stringify(configuration.mode),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.js","sourceRoot":"","sources":["../../../../src/webpack/config/plugin.ts"],"names":[],"mappings":";;;AAAA,kDAAkD;AAClD,+BAA+B;AAC/B,qCAAsD;
|
|
1
|
+
{"version":3,"file":"plugin.js","sourceRoot":"","sources":["../../../../src/webpack/config/plugin.ts"],"names":[],"mappings":";;;AAAA,+CAA4E;AAC5E,kDAAkD;AAClD,+BAA+B;AAC/B,qCAAsD;AAGtD,oDAAkD;AAElD,6CAAoD;AACpD,6FAAwF;AACxF,6CAA0D;AAC1D,+CAA+D;AAE/D,SAAgB,MAAM,CACpB,OAAiC,EACjC,aAAmC,EACnC,eAAqB;IAErB,IAAI,OAAO,CAAC,KAAK,IAAI,OAAO,OAAO,CAAC,KAAK,KAAK,QAAQ,EAAE,CAAC;QACvD,MAAM,IAAI,KAAK,CAAC,6CAA6C,CAAC,CAAC;IACjE,CAAC;IAED,MAAM,gBAAgB,GAAG,IAAI,yBAAgB,CAAC;QAC5C,cAAc,EAAE,OAAO,CAAC,OAAO;QAC/B,gBAAgB,EAAE,OAAO,CAAC,SAAS;QACnC,4BAA4B,EAAE,OAAO,CAAC,KAAe;KAC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AI;gBACjB,QAAQ,EAAE,IAAI,CAAC,SAAS,CAAC,aAAa,CAAC,IAAI,CAAC;gBAC5C,aAAa,EAAE,IAAI,CAAC,SAAS,CAAC,aAAa,CAAC,KAAK,CAAC;gBAClD,kBAAkB,EAAE,IAAI,CAAC,SAAS,CAAC,eAAe,CAAC,eAAe,EAAE,OAAO,CAAC,SAAS,CAAC,CAAC;gBACvF,eAAe,EAAE,IAAI,CAAC,SAAS,CAC7B,gBAAgB,CAAC,UAAU,CAAC,+BAA+B,CAAC,CAC7D;gBACD,eAAe,EAAE,IAAI,CAAC,SAAS,CAC7B,gBAAgB,CAAC,UAAU,CAAC,kCAAkC,CAAC,CAChE;gBACD,mBAAmB,EAAE,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC;aAC7D,CAAC;YACF,gBAAgB;YAChB,IAAA,uCAA0B,EAAC,OAAO,EAAE,eAAe,CAAC;YACpD,IAAI,UAAU,CAAC,QAAQ,CAAC;SACzB,CAAC,MAAM,CAAC,OAAO,CAAC;KAClB,CAAC;AACJ,CAAC;AA1ED,wBA0EC;AAED;;;;;;GAMG;AACH,SAAS,eAAe,CAAC,eAAqB,EAAE,GAAsB;IACpE,IAAK,GAAG,EAAE,aAAyB,KAAK,KAAK,EAAE,CAAC;QAC9C,OAAO;IACT,CAAC;IACD,IAAI,GAAG,EAAE,aAAa,EAAE,CAAC;QACvB,OAAO,IAAA,oBAAa,EAAC,IAAA,WAAI,EAAC,eAAe,EAAE,GAAG,CAAC,aAAuB,CAAC,CAAC,CAAC;IAC3E,CAAC;IACD,OAAO,OAAO,CAAC,OAAO,CAAC,8BAAc,CAAC,qBAAqB,CAAC,CAAC;AAC/D,CAAC"}
|
|
@@ -1,2 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import { EnvironmentOptions } from '../EnvironmentOptions';
|
|
2
|
+
import { ContextReplacementPlugin, Configuration } from 'webpack';
|
|
3
|
+
export declare function config(env: EnvironmentOptions): Configuration;
|
|
4
|
+
/**
|
|
5
|
+
* This plugin is used, to reduce the dynamic import of locales in Angular. It ensures
|
|
6
|
+
* that only locales that are used by the application are imported.
|
|
7
|
+
* @param env The environment options of the application.
|
|
8
|
+
* @returns A new ContextReplacementPlugin that replaces the locales in angular.
|
|
9
|
+
*/
|
|
10
|
+
export declare function getLocalesContextReplacePlugin(env: EnvironmentOptions): ContextReplacementPlugin;
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.config = void 0;
|
|
3
|
+
exports.getLocalesContextReplacePlugin = exports.config = void 0;
|
|
4
4
|
const path_1 = require("path");
|
|
5
|
-
|
|
5
|
+
const EnvironmentOptions_1 = require("../EnvironmentOptions");
|
|
6
|
+
const webpack_1 = require("webpack");
|
|
7
|
+
function config(env) {
|
|
6
8
|
return {
|
|
7
9
|
resolveLoader: {
|
|
8
10
|
alias: {
|
|
@@ -14,10 +16,35 @@ function config() {
|
|
|
14
16
|
{
|
|
15
17
|
test: /\.po$/,
|
|
16
18
|
use: ['c8y-po']
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
test: /angular-locales\.js$/,
|
|
22
|
+
use: [
|
|
23
|
+
{
|
|
24
|
+
loader: (0, path_1.resolve)(__dirname, '../loaders/loader-locales'),
|
|
25
|
+
options: {
|
|
26
|
+
locales: env.runTime.languages
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
]
|
|
17
30
|
}
|
|
18
31
|
]
|
|
19
32
|
}
|
|
20
33
|
};
|
|
21
34
|
}
|
|
22
35
|
exports.config = config;
|
|
36
|
+
/**
|
|
37
|
+
* This plugin is used, to reduce the dynamic import of locales in Angular. It ensures
|
|
38
|
+
* that only locales that are used by the application are imported.
|
|
39
|
+
* @param env The environment options of the application.
|
|
40
|
+
* @returns A new ContextReplacementPlugin that replaces the locales in angular.
|
|
41
|
+
*/
|
|
42
|
+
function getLocalesContextReplacePlugin(env) {
|
|
43
|
+
let usedLocales = Object.keys(env.runTime.languages || {});
|
|
44
|
+
if (usedLocales.length === 0) {
|
|
45
|
+
usedLocales = EnvironmentOptions_1.DEFAULT_LOCALES;
|
|
46
|
+
}
|
|
47
|
+
return new webpack_1.ContextReplacementPlugin(/@angular\/common\/locales$/, new RegExp(`\\/(${usedLocales.join('|')})\\.mjs$`));
|
|
48
|
+
}
|
|
49
|
+
exports.getLocalesContextReplacePlugin = getLocalesContextReplacePlugin;
|
|
23
50
|
//# sourceMappingURL=translation.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"translation.js","sourceRoot":"","sources":["../../../../src/webpack/config/translation.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"translation.js","sourceRoot":"","sources":["../../../../src/webpack/config/translation.ts"],"names":[],"mappings":";;;AAAA,+BAA+B;AAC/B,8DAA4E;AAC5E,qCAAkE;AAElE,SAAgB,MAAM,CAAC,GAAuB;IAC5C,OAAO;QACL,aAAa,EAAE;YACb,KAAK,EAAE;gBACL,QAAQ,EAAE,IAAA,cAAO,EAAC,SAAS,EAAE,sBAAsB,CAAC;aACrD;SACF;QACD,MAAM,EAAE;YACN,KAAK,EAAE;gBACL;oBACE,IAAI,EAAE,OAAO;oBACb,GAAG,EAAE,CAAC,QAAQ,CAAC;iBAChB;gBACD;oBACE,IAAI,EAAE,sBAAsB;oBAC5B,GAAG,EAAE;wBACH;4BACE,MAAM,EAAE,IAAA,cAAO,EAAC,SAAS,EAAE,2BAA2B,CAAC;4BACvD,OAAO,EAAE;gCACP,OAAO,EAAE,GAAG,CAAC,OAAO,CAAC,SAAS;6BAC/B;yBACF;qBACF;iBACF;aACF;SACF;KACF,CAAC;AACJ,CAAC;AA3BD,wBA2BC;AAED;;;;;GAKG;AACH,SAAgB,8BAA8B,CAAC,GAAuB;IACpE,IAAI,WAAW,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,SAAS,IAAI,EAAE,CAAC,CAAC;IAC3D,IAAI,WAAW,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC7B,WAAW,GAAG,oCAAe,CAAC;IAChC,CAAC;IAED,OAAO,IAAI,kCAAwB,CACjC,4BAA4B,EAC5B,IAAI,MAAM,CAAC,OAAO,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,CACnD,CAAC;AACJ,CAAC;AAVD,wEAUC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
/**
|
|
4
|
+
* This loader loads missing locales for angular.js. It is only
|
|
5
|
+
* used in hybrid applications and if the customer sets a non-default
|
|
6
|
+
* language.
|
|
7
|
+
*/
|
|
8
|
+
function loaderLocales(content) {
|
|
9
|
+
const options = this.getOptions();
|
|
10
|
+
const locales = Object.keys(options.locales || {});
|
|
11
|
+
if (locales.length === 0) {
|
|
12
|
+
return content;
|
|
13
|
+
}
|
|
14
|
+
locales.forEach(locale => {
|
|
15
|
+
if (!content.includes(`angular-locale_${locale}.js`)) {
|
|
16
|
+
content += `require('!file-loader?name=assets/locales/angular/angular-locale_${locale}.js!angular-i18n/angular-locale_${locale}.js');`;
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
return content;
|
|
20
|
+
}
|
|
21
|
+
exports.default = loaderLocales;
|
|
22
|
+
//# sourceMappingURL=loader-locales.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"loader-locales.js","sourceRoot":"","sources":["../../../../src/webpack/loaders/loader-locales.ts"],"names":[],"mappings":";;AAAA;;;;GAIG;AACH,SAAwB,aAAa,CAAY,OAAe;IAC9D,MAAM,OAAO,GAAG,IAAI,CAAC,UAAU,EAAE,CAAC;IAElC,MAAM,OAAO,GAAG,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC;IACnD,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACzB,OAAO,OAAO,CAAC;IACjB,CAAC;IAED,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE;QACvB,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,kBAAkB,MAAM,KAAK,CAAC,EAAE,CAAC;YACrD,OAAO,IAAI,oEAAoE,MAAM,mCAAmC,MAAM,QAAQ,CAAC;QACzI,CAAC;IACH,CAAC,CAAC,CAAC;IACH,OAAO,OAAO,CAAC;AACjB,CAAC;AAdD,gCAcC"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const poLoader = (content) => {
|
|
4
4
|
const poContent = content;
|
|
5
|
-
// Workaround as returning content
|
|
5
|
+
// Workaround as returning content without wrapping it result in some errors.
|
|
6
6
|
return JSON.stringify(poContent);
|
|
7
7
|
};
|
|
8
8
|
exports.default = poLoader;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loader-po.js","sourceRoot":"","sources":["../../../../src/webpack/loaders/loader-po.ts"],"names":[],"mappings":";;AAEA,MAAM,QAAQ,GAA6B,CAAC,OAAe,EAAE,EAAE;IAC7D,MAAM,SAAS,GAAG,OAAO,CAAC;IAC1B,
|
|
1
|
+
{"version":3,"file":"loader-po.js","sourceRoot":"","sources":["../../../../src/webpack/loaders/loader-po.ts"],"names":[],"mappings":";;AAEA,MAAM,QAAQ,GAA6B,CAAC,OAAe,EAAE,EAAE;IAC7D,MAAM,SAAS,GAAG,OAAO,CAAC;IAC1B,6EAA6E;IAC7E,OAAO,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC;AACnC,CAAC,CAAC;AAEF,kBAAe,QAAQ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@c8y/devkit",
|
|
3
|
-
"version": "1020.0.
|
|
3
|
+
"version": "1020.0.24",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"author": "Cumulocity",
|
|
6
6
|
"description": "Cumulocity Webpack Build Facade",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"@babel/plugin-syntax-dynamic-import": "7.8.3",
|
|
47
47
|
"@babel/plugin-transform-async-to-generator": "^7.18.6",
|
|
48
48
|
"@babel/preset-env": "^7.24.4",
|
|
49
|
-
"@c8y/client": "1020.0.
|
|
49
|
+
"@c8y/client": "1020.0.24",
|
|
50
50
|
"@schematics/angular": "^17.3.1",
|
|
51
51
|
"angular-gettext-tools": "2.5.3",
|
|
52
52
|
"autoprefixer": "10.4.19",
|
|
@@ -94,7 +94,7 @@
|
|
|
94
94
|
"@types/webpack": "^5.28.5",
|
|
95
95
|
"@types/webpack-dev-server": "^4.3.1",
|
|
96
96
|
"@types/inquirer": "9.0.7",
|
|
97
|
-
"@c8y/options": "1020.0.
|
|
97
|
+
"@c8y/options": "1020.0.24"
|
|
98
98
|
},
|
|
99
99
|
"peerDependencies": {
|
|
100
100
|
"@angular-devkit/build-angular": "^17.3.1",
|