@servicetitan/startup 30.0.0 → 30.1.0
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/webpack/configs/plugins/assets-manifest-plugin.d.ts +1 -1
- package/dist/webpack/configs/plugins/assets-manifest-plugin.d.ts.map +1 -1
- package/dist/webpack/configs/plugins/assets-manifest-plugin.js +4 -6
- package/dist/webpack/configs/plugins/assets-manifest-plugin.js.map +1 -1
- package/dist/webpack/configs/plugins/moment-locales-plugin.d.ts +1 -2
- package/dist/webpack/configs/plugins/moment-locales-plugin.d.ts.map +1 -1
- package/dist/webpack/configs/plugins/moment-locales-plugin.js +13 -7
- package/dist/webpack/configs/plugins/moment-locales-plugin.js.map +1 -1
- package/dist/webpack/utils/testing/normalize-errors.d.ts +1 -2
- package/dist/webpack/utils/testing/normalize-errors.d.ts.map +1 -1
- package/dist/webpack/utils/testing/normalize-errors.js.map +1 -1
- package/package.json +28 -21
- package/src/cli/utils/__tests__/bundle.test.ts +5 -0
- package/src/webpack/__tests__/create-webpack-config-web-component.test.ts +2 -2
- package/src/webpack/__tests__/create-webpack-config.test.ts +1 -1
- package/src/webpack/configs/plugins/assets-manifest-plugin.ts +3 -2
- package/src/webpack/configs/plugins/moment-locales-plugin.ts +17 -4
- package/src/webpack/utils/testing/normalize-errors.ts +1 -3
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import WebpackAssetsManifest from 'webpack-assets-manifest';
|
|
1
|
+
import { WebpackAssetsManifest } from 'webpack-assets-manifest';
|
|
2
2
|
import { Context, Overrides } from '../types';
|
|
3
3
|
export declare function assetsManifestPlugin(context: Context, _: Overrides): WebpackAssetsManifest | undefined;
|
|
4
4
|
//# sourceMappingURL=assets-manifest-plugin.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"assets-manifest-plugin.d.ts","sourceRoot":"","sources":["../../../../src/webpack/configs/plugins/assets-manifest-plugin.ts"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"assets-manifest-plugin.d.ts","sourceRoot":"","sources":["../../../../src/webpack/configs/plugins/assets-manifest-plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAG9C,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,SAAS,qCA8BlE"}
|
|
@@ -1,16 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.assetsManifestPlugin = assetsManifestPlugin;
|
|
7
|
-
const webpack_assets_manifest_1 =
|
|
4
|
+
const webpack_assets_manifest_1 = require("webpack-assets-manifest");
|
|
8
5
|
const utils_1 = require("../utils");
|
|
9
6
|
function assetsManifestPlugin(context, _) {
|
|
10
7
|
if (!context.isWebComponent) {
|
|
11
8
|
return;
|
|
12
9
|
}
|
|
13
|
-
return new webpack_assets_manifest_1.
|
|
10
|
+
return new webpack_assets_manifest_1.WebpackAssetsManifest({
|
|
14
11
|
entrypoints: true,
|
|
15
12
|
output: 'entrypoints.json',
|
|
16
13
|
transform(assets) {
|
|
@@ -25,7 +22,8 @@ function assetsManifestPlugin(context, _) {
|
|
|
25
22
|
js: getAssetsByType('js'),
|
|
26
23
|
};
|
|
27
24
|
},
|
|
28
|
-
|
|
25
|
+
// eslint-disable-next-line @typescript-eslint/require-await
|
|
26
|
+
done: async (_manifest) => {
|
|
29
27
|
(0, utils_1.generateMetadata)(context);
|
|
30
28
|
},
|
|
31
29
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"assets-manifest-plugin.js","sourceRoot":"","sources":["../../../../src/webpack/configs/plugins/assets-manifest-plugin.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"assets-manifest-plugin.js","sourceRoot":"","sources":["../../../../src/webpack/configs/plugins/assets-manifest-plugin.ts"],"names":[],"mappings":";;AAIA,oDA8BC;AAlCD,qEAAgE;AAEhE,oCAA4C;AAE5C,SAAgB,oBAAoB,CAAC,OAAgB,EAAE,CAAY;IAC/D,IAAI,CAAC,OAAO,CAAC,cAAc,EAAE,CAAC;QAC1B,OAAO;IACX,CAAC;IAED,OAAO,IAAI,+CAAqB,CAAC;QAC7B,WAAW,EAAE,IAAI;QACjB,MAAM,EAAE,kBAAkB;QAC1B,SAAS,CAAC,MAAM;YACZ,MAAM,WAAW,GAAG,MAAM,CAAC,WAG1B,CAAC;YAEF,MAAM,eAAe,GAAG,CAAC,IAAY,EAAE,EAAE;gBACrC,OAAO,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC;qBAC5B,GAAG,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,WAAC,OAAA,MAAA,MAAM,CAAC,IAAI,CAAC,mCAAI,EAAE,CAAA,EAAA,CAAC;qBACvC,IAAI,EAAE,CAAC;YAChB,CAAC,CAAC;YAEF,OAAO;gBACH,GAAG,EAAE,eAAe,CAAC,KAAK,CAAC;gBAC3B,EAAE,EAAE,eAAe,CAAC,IAAI,CAAC;aAC5B,CAAC;QACN,CAAC;QACD,4DAA4D;QAC5D,IAAI,EAAE,KAAK,EAAE,SAAgC,EAAE,EAAE;YAC7C,IAAA,wBAAgB,EAAC,OAAO,CAAC,CAAC;QAC9B,CAAC;KACJ,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import MomentLocalesPlugin from 'moment-locales-webpack-plugin';
|
|
2
1
|
import { Context, Overrides } from '../types';
|
|
3
|
-
export declare function momentLocalesPlugin(_: Context, _overrides: Overrides):
|
|
2
|
+
export declare function momentLocalesPlugin(_: Context, _overrides: Overrides): import("moment-locales-webpack-plugin") | undefined;
|
|
4
3
|
//# sourceMappingURL=moment-locales-plugin.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"moment-locales-plugin.d.ts","sourceRoot":"","sources":["../../../../src/webpack/configs/plugins/moment-locales-plugin.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"moment-locales-plugin.d.ts","sourceRoot":"","sources":["../../../../src/webpack/configs/plugins/moment-locales-plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAK9C,wBAAgB,mBAAmB,CAAC,CAAC,EAAE,OAAO,EAAE,UAAU,EAAE,SAAS,uDAOpE"}
|
|
@@ -1,13 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.momentLocalesPlugin = momentLocalesPlugin;
|
|
7
|
-
const
|
|
4
|
+
const MomentLocalesPlugin = isMomentInstalled() ? require('moment-locales-webpack-plugin') : undefined;
|
|
8
5
|
function momentLocalesPlugin(_, _overrides) {
|
|
9
|
-
return
|
|
10
|
-
|
|
11
|
-
|
|
6
|
+
return (MomentLocalesPlugin &&
|
|
7
|
+
new MomentLocalesPlugin({
|
|
8
|
+
localesToKeep: ['en-au', 'en-ca', 'en-gb'],
|
|
9
|
+
}));
|
|
10
|
+
}
|
|
11
|
+
function isMomentInstalled() {
|
|
12
|
+
try {
|
|
13
|
+
return !!require.resolve('moment');
|
|
14
|
+
}
|
|
15
|
+
catch (_a) {
|
|
16
|
+
return false;
|
|
17
|
+
}
|
|
12
18
|
}
|
|
13
19
|
//# sourceMappingURL=moment-locales-plugin.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"moment-locales-plugin.js","sourceRoot":"","sources":["../../../../src/webpack/configs/plugins/moment-locales-plugin.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"moment-locales-plugin.js","sourceRoot":"","sources":["../../../../src/webpack/configs/plugins/moment-locales-plugin.ts"],"names":[],"mappings":";;AAKA,kDAOC;AAVD,MAAM,mBAAmB,GACrB,iBAAiB,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,+BAA+B,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;AAE/E,SAAgB,mBAAmB,CAAC,CAAU,EAAE,UAAqB;IACjE,OAAO,CACH,mBAAmB;QACnB,IAAI,mBAAmB,CAAC;YACpB,aAAa,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC;SAC7C,CAAC,CACL,CAAC;AACN,CAAC;AAED,SAAS,iBAAiB;IACtB,IAAI,CAAC;QACD,OAAO,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IACvC,CAAC;IAAC,WAAM,CAAC;QACL,OAAO,KAAK,CAAC;IACjB,CAAC;AACL,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"normalize-errors.d.ts","sourceRoot":"","sources":["../../../../src/webpack/utils/testing/normalize-errors.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"normalize-errors.d.ts","sourceRoot":"","sources":["../../../../src/webpack/utils/testing/normalize-errors.ts"],"names":[],"mappings":"AAaA,wBAAgB,eAAe,CAAC,MAAM,EAAE,KAAK,EAAE,YAE9C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"normalize-errors.js","sourceRoot":"","sources":["../../../../src/webpack/utils/testing/normalize-errors.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"normalize-errors.js","sourceRoot":"","sources":["../../../../src/webpack/utils/testing/normalize-errors.ts"],"names":[],"mappings":";;AAaA,0CAEC;AAfD,SAAS,SAAS,CAAC,GAAW;IAC1B,MAAM,KAAK,GAAG,OAAO,CAAC,QAAQ,KAAK,OAAO,CAAC;IAC3C,IAAI,GAAG,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;IAExB,IAAI,KAAK,EAAE,CAAC;QACR,6CAA6C;QAC7C,GAAG,GAAG,GAAG,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;QAC9B,GAAG,GAAG,GAAG,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;IAClC,CAAC;IAED,OAAO,GAAG,CAAC,OAAO,CAAC,IAAI,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,EAAE,CAAC,CAAC;AACjD,CAAC;AAED,SAAgB,eAAe,CAAC,MAAe;IAC3C,OAAO,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,SAAS,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAC5F,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@servicetitan/startup",
|
|
3
|
-
"version": "30.
|
|
3
|
+
"version": "30.1.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"homepage": "https://docs.st.dev/docs/frontend/startup",
|
|
6
6
|
"repository": {
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"devDependencies": {
|
|
26
26
|
"@types/cpx": "~1.5.5",
|
|
27
27
|
"@types/eslint": "~9.6.1",
|
|
28
|
-
"@types/less": "~3.0.
|
|
28
|
+
"@types/less": "~3.0.8",
|
|
29
29
|
"@types/lodash.memoize": "^4.1.9",
|
|
30
30
|
"@types/moment-locales-webpack-plugin": "~1.2.2",
|
|
31
31
|
"@types/webpack-assets-manifest": "~5.1.4",
|
|
@@ -36,11 +36,11 @@
|
|
|
36
36
|
"@jest/core": "~29.7.0",
|
|
37
37
|
"@jest/types": "~29.6.3",
|
|
38
38
|
"@jsdevtools/coverage-istanbul-loader": "^3.0.5",
|
|
39
|
-
"@servicetitan/eslint-config": "30.
|
|
40
|
-
"@servicetitan/stylelint-config": "30.
|
|
39
|
+
"@servicetitan/eslint-config": "30.1.0",
|
|
40
|
+
"@servicetitan/stylelint-config": "30.1.0",
|
|
41
41
|
"@svgr/webpack": "^8.1.0",
|
|
42
|
-
"@swc/cli": "0.
|
|
43
|
-
"@swc/core": "1.11.
|
|
42
|
+
"@swc/cli": "0.7.3",
|
|
43
|
+
"@swc/core": "1.11.24",
|
|
44
44
|
"@types/debug": "^4.1.12",
|
|
45
45
|
"@types/jest": "~29.5.12",
|
|
46
46
|
"chalk": "~4.1.2",
|
|
@@ -51,10 +51,10 @@
|
|
|
51
51
|
"debug": "^4.4.0",
|
|
52
52
|
"deepmerge": "~4.3.1",
|
|
53
53
|
"esbuild-loader": "~4.3.0",
|
|
54
|
-
"eslint": "~9.
|
|
54
|
+
"eslint": "~9.25.1",
|
|
55
55
|
"execa": "~5.1.1",
|
|
56
|
-
"fork-ts-checker-webpack-plugin": "~9.0
|
|
57
|
-
"glob": "~11.0.
|
|
56
|
+
"fork-ts-checker-webpack-plugin": "~9.1.0",
|
|
57
|
+
"glob": "~11.0.2",
|
|
58
58
|
"html-webpack-plugin": "~5.6.3",
|
|
59
59
|
"identity-obj-proxy": "~3.0.0",
|
|
60
60
|
"jest": "~29.7.0",
|
|
@@ -62,36 +62,35 @@
|
|
|
62
62
|
"jest-environment-jsdom": "^29.7.0",
|
|
63
63
|
"jest-fetch-mock": "~3.0.3",
|
|
64
64
|
"json5": "^2.2.3",
|
|
65
|
-
"lerna": "~8.2.
|
|
66
|
-
"less": "~4.
|
|
65
|
+
"lerna": "~8.2.2",
|
|
66
|
+
"less": "~4.3.0",
|
|
67
67
|
"less-loader": "~12.2.0",
|
|
68
68
|
"less-plugin-npm-import": "~2.1.0",
|
|
69
69
|
"lodash.memoize": "^4.1.2",
|
|
70
70
|
"memfs": "~4.17.0",
|
|
71
71
|
"mini-css-extract-plugin": "~2.9.2",
|
|
72
|
-
"moment": "^2.30.1",
|
|
73
72
|
"moment-locales-webpack-plugin": "~1.2.0",
|
|
74
73
|
"multimatch": "~5.0.0",
|
|
75
|
-
"portfinder": "~1.0.
|
|
74
|
+
"portfinder": "~1.0.37",
|
|
76
75
|
"postcss": "~8.5.3",
|
|
77
76
|
"prettier": "~3.5.3",
|
|
78
|
-
"sass": "~1.
|
|
77
|
+
"sass": "~1.87.0",
|
|
79
78
|
"sass-loader": "~16.0.5",
|
|
80
79
|
"source-map-loader": "~5.0.0",
|
|
81
80
|
"style-loader": "~4.0.0",
|
|
82
|
-
"stylelint": "~16.
|
|
81
|
+
"stylelint": "~16.19.1",
|
|
83
82
|
"swc-loader": "0.2.6",
|
|
84
83
|
"terser-webpack-plugin": "^5.3.14",
|
|
85
|
-
"ts-jest": "29.2
|
|
84
|
+
"ts-jest": "29.3.2",
|
|
86
85
|
"ts-loader": "~9.5.2",
|
|
87
86
|
"ts-node": "~10.9.2",
|
|
88
87
|
"typed-css-modules": "~0.9.1",
|
|
89
|
-
"typescript": "5.8.
|
|
88
|
+
"typescript": "5.8.3",
|
|
90
89
|
"username": "~5.1.0",
|
|
91
|
-
"webpack": "~5.
|
|
92
|
-
"webpack-assets-manifest": "~
|
|
90
|
+
"webpack": "~5.99.7",
|
|
91
|
+
"webpack-assets-manifest": "~6.0.2",
|
|
93
92
|
"webpack-bundle-analyzer": "^4.10.2",
|
|
94
|
-
"webpack-dev-server": "~5.2.
|
|
93
|
+
"webpack-dev-server": "~5.2.1",
|
|
95
94
|
"webpack-filter-warnings-plugin": "~1.2.1",
|
|
96
95
|
"webpack-merge": "~6.0.1",
|
|
97
96
|
"webpack-virtual-modules": "~0.6.2",
|
|
@@ -99,6 +98,14 @@
|
|
|
99
98
|
"xhr-mock": "~2.5.1",
|
|
100
99
|
"yargs": "~17.7.2"
|
|
101
100
|
},
|
|
101
|
+
"peerDependencies": {
|
|
102
|
+
"moment": "^2.30.1"
|
|
103
|
+
},
|
|
104
|
+
"peerDependenciesMeta": {
|
|
105
|
+
"moment": {
|
|
106
|
+
"optional": true
|
|
107
|
+
}
|
|
108
|
+
},
|
|
102
109
|
"DEVELOPER_NOTES": {},
|
|
103
110
|
"publishConfig": {
|
|
104
111
|
"access": "public"
|
|
@@ -106,5 +113,5 @@
|
|
|
106
113
|
"cli": {
|
|
107
114
|
"webpack": false
|
|
108
115
|
},
|
|
109
|
-
"gitHead": "
|
|
116
|
+
"gitHead": "ebfab3b30337bab2d2c7b1bf6a1caeedc262c884"
|
|
110
117
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { fs, vol } from 'memfs';
|
|
2
2
|
import path from 'path';
|
|
3
|
+
import { getPortPromise } from 'portfinder';
|
|
3
4
|
import webpack from 'webpack';
|
|
4
5
|
import WebpackDevServer from 'webpack-dev-server';
|
|
5
6
|
import {
|
|
@@ -19,6 +20,7 @@ import {
|
|
|
19
20
|
} from '../bundle';
|
|
20
21
|
|
|
21
22
|
jest.mock('fs', () => fs);
|
|
23
|
+
jest.mock('portfinder');
|
|
22
24
|
jest.mock('webpack', () => jest.fn());
|
|
23
25
|
jest.mock('webpack-dev-server');
|
|
24
26
|
jest.mock('../../../utils', () => ({
|
|
@@ -39,6 +41,9 @@ describe('[startup] Cli Utils', () => {
|
|
|
39
41
|
jest.resetAllMocks();
|
|
40
42
|
jest.mocked(createWebpackConfig).mockReturnValue(createWebpackResult);
|
|
41
43
|
jest.mocked(webpack).mockImplementation((): any => compiler);
|
|
44
|
+
jest.mocked(getPortPromise).mockImplementation(options =>
|
|
45
|
+
Promise.resolve(options?.port ?? 0)
|
|
46
|
+
);
|
|
42
47
|
compiler = { close: jest.fn(callback => callback(null)) };
|
|
43
48
|
});
|
|
44
49
|
|
|
@@ -3,7 +3,7 @@ import MiniCssExtractPlugin from 'mini-css-extract-plugin';
|
|
|
3
3
|
import { fs, vol } from 'memfs';
|
|
4
4
|
import path from 'path';
|
|
5
5
|
import { DefinePlugin } from 'webpack';
|
|
6
|
-
import WebpackAssetsManifest from 'webpack-assets-manifest';
|
|
6
|
+
import { WebpackAssetsManifest } from 'webpack-assets-manifest';
|
|
7
7
|
import VirtualModulesPlugin from 'webpack-virtual-modules';
|
|
8
8
|
|
|
9
9
|
import { webpackDevConfigFileName, webpackProdConfigFileName } from '../../cli/utils';
|
|
@@ -32,7 +32,7 @@ jest.mock('webpack', () => ({
|
|
|
32
32
|
...jest.requireActual('webpack'),
|
|
33
33
|
DefinePlugin: jest.fn(),
|
|
34
34
|
}));
|
|
35
|
-
jest.mock('webpack-assets-manifest', () => jest.fn());
|
|
35
|
+
jest.mock('webpack-assets-manifest', () => ({ WebpackAssetsManifest: jest.fn() }));
|
|
36
36
|
jest.mock('webpack-virtual-modules', () => jest.fn());
|
|
37
37
|
jest.mock('../../utils', () => ({
|
|
38
38
|
...jest.requireActual('../../utils'),
|
|
@@ -50,7 +50,7 @@ jest.mock('webpack', () => ({
|
|
|
50
50
|
IgnorePlugin: jest.fn(),
|
|
51
51
|
ProvidePlugin: jest.fn(),
|
|
52
52
|
}));
|
|
53
|
-
jest.mock('webpack-assets-manifest', () => jest.fn());
|
|
53
|
+
jest.mock('webpack-assets-manifest', () => ({ WebpackAssetsManifest: jest.fn() }));
|
|
54
54
|
jest.mock('webpack-bundle-analyzer', () => ({ BundleAnalyzerPlugin: jest.fn() }));
|
|
55
55
|
jest.mock('webpack-filter-warnings-plugin', () => jest.fn());
|
|
56
56
|
jest.mock('webpack-virtual-modules', () => jest.fn());
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import WebpackAssetsManifest from 'webpack-assets-manifest';
|
|
1
|
+
import { WebpackAssetsManifest } from 'webpack-assets-manifest';
|
|
2
2
|
import { Context, Overrides } from '../types';
|
|
3
3
|
import { generateMetadata } from '../utils';
|
|
4
4
|
|
|
@@ -27,7 +27,8 @@ export function assetsManifestPlugin(context: Context, _: Overrides) {
|
|
|
27
27
|
js: getAssetsByType('js'),
|
|
28
28
|
};
|
|
29
29
|
},
|
|
30
|
-
|
|
30
|
+
// eslint-disable-next-line @typescript-eslint/require-await
|
|
31
|
+
done: async (_manifest: WebpackAssetsManifest) => {
|
|
31
32
|
generateMetadata(context);
|
|
32
33
|
},
|
|
33
34
|
});
|
|
@@ -1,8 +1,21 @@
|
|
|
1
|
-
import MomentLocalesPlugin from 'moment-locales-webpack-plugin';
|
|
2
1
|
import { Context, Overrides } from '../types';
|
|
3
2
|
|
|
3
|
+
const MomentLocalesPlugin: typeof import('moment-locales-webpack-plugin') | undefined =
|
|
4
|
+
isMomentInstalled() ? require('moment-locales-webpack-plugin') : undefined;
|
|
5
|
+
|
|
4
6
|
export function momentLocalesPlugin(_: Context, _overrides: Overrides) {
|
|
5
|
-
return
|
|
6
|
-
|
|
7
|
-
|
|
7
|
+
return (
|
|
8
|
+
MomentLocalesPlugin &&
|
|
9
|
+
new MomentLocalesPlugin({
|
|
10
|
+
localesToKeep: ['en-au', 'en-ca', 'en-gb'],
|
|
11
|
+
})
|
|
12
|
+
);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
function isMomentInstalled() {
|
|
16
|
+
try {
|
|
17
|
+
return !!require.resolve('moment');
|
|
18
|
+
} catch {
|
|
19
|
+
return false;
|
|
20
|
+
}
|
|
8
21
|
}
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { WebpackError } from 'webpack';
|
|
2
|
-
|
|
3
1
|
function removeCWD(str: string) {
|
|
4
2
|
const isWin = process.platform === 'win32';
|
|
5
3
|
let cwd = process.cwd();
|
|
@@ -13,6 +11,6 @@ function removeCWD(str: string) {
|
|
|
13
11
|
return str.replace(new RegExp(cwd, 'g'), '');
|
|
14
12
|
}
|
|
15
13
|
|
|
16
|
-
export function normalizeErrors(errors:
|
|
14
|
+
export function normalizeErrors(errors: Error[]) {
|
|
17
15
|
return errors.map(error => removeCWD(error.message.split('\n').slice(0, 2).join('\n')));
|
|
18
16
|
}
|