@zohodesk/client_build_tool 0.0.6-exp.31 → 0.0.6-exp.33
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/lib/schemas/defaultConfigValues.js +3 -1
- package/lib/shared/bundler/webpack/custom_plugins/ManifestJsonPlugin/addFilesNamesToManifestJson.js +8 -2
- package/lib/shared/bundler/webpack/custom_plugins/ManifestJsonPlugin/createInitialEntries.js +7 -1
- package/lib/shared/bundler/webpack/custom_plugins/ManifestJsonPlugin/createManifestJson.js +1 -1
- package/lib/shared/bundler/webpack/pluginConfigs/configManifestJsonPlugin.js +25 -13
- package/package.json +1 -1
package/lib/shared/bundler/webpack/custom_plugins/ManifestJsonPlugin/addFilesNamesToManifestJson.js
CHANGED
|
@@ -5,8 +5,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.addFilesNamesToManifestJson = addFilesNamesToManifestJson;
|
|
7
7
|
|
|
8
|
+
var _path = _interopRequireDefault(require("path"));
|
|
9
|
+
|
|
8
10
|
var _removeHashFromFileName = require("./removeHashFromFileName");
|
|
9
11
|
|
|
12
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
+
|
|
10
14
|
function addFilesNamesToManifestJson({
|
|
11
15
|
manifestJson,
|
|
12
16
|
option,
|
|
@@ -15,9 +19,11 @@ function addFilesNamesToManifestJson({
|
|
|
15
19
|
}) {
|
|
16
20
|
const json = manifestJson;
|
|
17
21
|
Object.keys(assets).forEach(filename => {
|
|
22
|
+
const fileName = _path.default.parse(filename).base;
|
|
23
|
+
|
|
18
24
|
if (option.test(filename)) {
|
|
19
|
-
const filenameNameWithoutHash = (0, _removeHashFromFileName.removeHashFromFileName)(
|
|
20
|
-
json[filenameNameWithoutHash] =
|
|
25
|
+
const filenameNameWithoutHash = (0, _removeHashFromFileName.removeHashFromFileName)(fileName, hashDigestLength);
|
|
26
|
+
json[filenameNameWithoutHash] = fileName;
|
|
21
27
|
}
|
|
22
28
|
});
|
|
23
29
|
return json;
|
package/lib/shared/bundler/webpack/custom_plugins/ManifestJsonPlugin/createInitialEntries.js
CHANGED
|
@@ -5,11 +5,17 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.createInitialEntriesForManifestJson = createInitialEntriesForManifestJson;
|
|
7
7
|
|
|
8
|
+
var _path = _interopRequireDefault(require("path"));
|
|
9
|
+
|
|
8
10
|
var _removeHashFromFileName = require("./removeHashFromFileName");
|
|
9
11
|
|
|
12
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
+
|
|
10
14
|
function createInitialEntriesForManifestJson(initialFileNames, hashLength) {
|
|
11
15
|
const initialEntries = {};
|
|
12
|
-
initialFileNames.forEach(
|
|
16
|
+
initialFileNames.forEach(filename => {
|
|
17
|
+
const fileName = _path.default.parse(filename).base;
|
|
18
|
+
|
|
13
19
|
const filenameNameWithoutHash = (0, _removeHashFromFileName.removeHashFromFileName)(fileName, hashLength);
|
|
14
20
|
initialEntries[filenameNameWithoutHash] = fileName;
|
|
15
21
|
});
|
|
@@ -22,7 +22,7 @@ function createManifestJson({
|
|
|
22
22
|
if (option.needInitialEntries) {
|
|
23
23
|
const initialFileNames = (0, _findInitialFileNames.findInitialFileNames)(compilation);
|
|
24
24
|
const initialEntries = (0, _createInitialEntries.createInitialEntriesForManifestJson)(initialFileNames, hashDigestLength);
|
|
25
|
-
manifestJson.
|
|
25
|
+
manifestJson.entryFiles = initialEntries;
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
const outputJson = (0, _addFilesNamesToManifestJson.addFilesNamesToManifestJson)({
|
|
@@ -9,24 +9,36 @@ var _ManifestJsonPlugin = require("../custom_plugins/ManifestJsonPlugin");
|
|
|
9
9
|
|
|
10
10
|
function configManifestJsonPlugin(options) {
|
|
11
11
|
const {
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
enable,
|
|
13
|
+
i18nManifestJson,
|
|
14
|
+
licenseManifest
|
|
15
|
+
} = options.manifestJson;
|
|
14
16
|
|
|
15
|
-
if (!
|
|
17
|
+
if (!enable) {
|
|
16
18
|
return null;
|
|
17
19
|
}
|
|
18
20
|
|
|
19
|
-
|
|
21
|
+
const params = [{
|
|
20
22
|
outputJsonFileName: 'manifest.json',
|
|
21
23
|
test: f => !/\.i18n\.js$|\.LICENSE\.txt$|\.map$/.test(f),
|
|
22
24
|
needInitialEntries: true
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
}
|
|
25
|
+
}];
|
|
26
|
+
|
|
27
|
+
if (i18nManifestJson) {
|
|
28
|
+
params.push({
|
|
29
|
+
outputJsonFileName: 'i18nManifest.json',
|
|
30
|
+
test: f => /\.i18n\.js$/g.test(f),
|
|
31
|
+
needInitialEntries: false
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
if (licenseManifest) {
|
|
36
|
+
params.push({
|
|
37
|
+
outputJsonFileName: 'licenseManifest.json',
|
|
38
|
+
test: f => /\.LICENSE\.txt$/g.test(f),
|
|
39
|
+
needInitialEntries: false
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
return new _ManifestJsonPlugin.AddFileToManifestJson(params);
|
|
32
44
|
}
|