@infomaximum/package-cli 2.1.0 → 2.1.1
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/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
### [2.1.1](https://github.com/Infomaximum/package-cli/compare/v2.1.0...v2.1.1) (2024-03-07)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* исправлено копирование директории с ресурсами во время сборки ([e351a48](https://github.com/Infomaximum/package-cli/commit/e351a48d5bcb274b03e0ee2a97361d6a5c526ada))
|
|
11
|
+
|
|
5
12
|
## [2.1.0](https://github.com/Infomaximum/package-cli/compare/v2.0.1...v2.1.0) (2024-03-05)
|
|
6
13
|
|
|
7
14
|
|
|
@@ -3,7 +3,7 @@ import { TsconfigPathsPlugin } from "tsconfig-paths-webpack-plugin";
|
|
|
3
3
|
import CopyWebpackPlugin from "copy-webpack-plugin";
|
|
4
4
|
import webpack, {} from "webpack";
|
|
5
5
|
import { cssLoaders } from "./sections/loaders/cssLoaders.js";
|
|
6
|
-
import { systemRequire } from "../../../utils.js";
|
|
6
|
+
import { compact, systemRequire } from "../../../utils.js";
|
|
7
7
|
import { MANIFEST_REG_EXP } from "../../../const.js";
|
|
8
8
|
import path from "path";
|
|
9
9
|
const { ProgressPlugin } = webpack;
|
|
@@ -19,7 +19,7 @@ export const getCommonWidgetConfig = (mode, PATHS) => {
|
|
|
19
19
|
asyncChunks: false,
|
|
20
20
|
clean: true,
|
|
21
21
|
},
|
|
22
|
-
plugins: [
|
|
22
|
+
plugins: compact([
|
|
23
23
|
new ProgressPlugin(),
|
|
24
24
|
new ForkTsCheckerWebpackPlugin({
|
|
25
25
|
typescript: {
|
|
@@ -31,17 +31,18 @@ export const getCommonWidgetConfig = (mode, PATHS) => {
|
|
|
31
31
|
},
|
|
32
32
|
}),
|
|
33
33
|
PATHS.widgetResourcesPath &&
|
|
34
|
+
PATHS.widgetResourcesDirName &&
|
|
34
35
|
new CopyWebpackPlugin({
|
|
35
36
|
patterns: [
|
|
36
37
|
{
|
|
37
38
|
from: PATHS.widgetResourcesPath,
|
|
38
39
|
toType: "dir",
|
|
39
|
-
to:
|
|
40
|
+
to: PATHS.widgetResourcesDirName,
|
|
40
41
|
noErrorOnMissing: true,
|
|
41
42
|
},
|
|
42
43
|
],
|
|
43
44
|
}),
|
|
44
|
-
]
|
|
45
|
+
]),
|
|
45
46
|
module: {
|
|
46
47
|
rules: [
|
|
47
48
|
{
|
|
@@ -2,12 +2,12 @@ import ZipPlugin from "zip-webpack-plugin";
|
|
|
2
2
|
import { WIDGET_ARCHIVE_NAME } from "../../../../const.js";
|
|
3
3
|
import { BUILD_ARCHIVE_EXT, MANIFEST_JSON_FILE_NAME, } from "../../../../../const.js";
|
|
4
4
|
import { compact } from "../../../../../utils.js";
|
|
5
|
-
export const getZipWidgetPlugin = ({ isOnlyManifest,
|
|
5
|
+
export const getZipWidgetPlugin = ({ isOnlyManifest, widgetResourcesDirName, }) => {
|
|
6
6
|
return new ZipPlugin({
|
|
7
7
|
filename: WIDGET_ARCHIVE_NAME,
|
|
8
8
|
extension: BUILD_ARCHIVE_EXT,
|
|
9
9
|
include: isOnlyManifest
|
|
10
|
-
? compact([MANIFEST_JSON_FILE_NAME,
|
|
10
|
+
? compact([MANIFEST_JSON_FILE_NAME, widgetResourcesDirName])
|
|
11
11
|
: undefined,
|
|
12
12
|
});
|
|
13
13
|
};
|
|
@@ -21,7 +21,7 @@ export const runBuild = (args) => __awaiter(void 0, void 0, void 0, function* ()
|
|
|
21
21
|
plugins: [
|
|
22
22
|
getZipWidgetPlugin({
|
|
23
23
|
isOnlyManifest: isBuildDevMode,
|
|
24
|
-
|
|
24
|
+
widgetResourcesDirName: WIDGET_PATHS.widgetResourcesDirName,
|
|
25
25
|
}),
|
|
26
26
|
getModifyManifestWidgetPlugin({
|
|
27
27
|
isBuildDevMode,
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import path from "node:path";
|
|
1
2
|
import { _resolveApp, generateGlobalPaths, generateIndexPath, } from "../paths.js";
|
|
2
3
|
export function generateWidgetPaths({ entry, assetsDir, widgetManifest, buildDir, }) {
|
|
3
4
|
const globalPaths = generateGlobalPaths({ buildDirPath: buildDir });
|
|
4
5
|
const resolveApp = _resolveApp();
|
|
5
6
|
return Object.assign(Object.assign({}, globalPaths), { get moduleIndex() {
|
|
6
7
|
return generateIndexPath(entry);
|
|
7
|
-
}, widgetManifestJsonPath: resolveApp(widgetManifest), widgetResourcesPath: assetsDir ? resolveApp(assetsDir) : null, widgetBuildDirPath: resolveApp(buildDir) });
|
|
8
|
+
}, widgetManifestJsonPath: resolveApp(widgetManifest), widgetResourcesPath: assetsDir ? resolveApp(assetsDir) : null, widgetResourcesDirName: assetsDir ? path.basename(assetsDir) : null, widgetBuildDirPath: resolveApp(buildDir) });
|
|
8
9
|
}
|