@zohodesk/client_build_tool 0.0.22-exp.2 → 0.0.22-exp.3
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/README.md +1205 -0
- package/README_backup.md +1205 -0
- package/lib/schemas/defaultConfigValues.js +1 -0
- package/lib/schemas/defaultConfigValuesOnly.js +5 -0
- package/lib/shared/bundler/webpack/configCustomLoaders.js +4 -1
- package/lib/shared/bundler/webpack/entryConfig.js +3 -2
- package/lib/shared/bundler/webpack/loaderConfigs/configHtmlTemplateLoader.js +0 -8
- package/lib/shared/bundler/webpack/optimizationConfig.js +8 -0
- package/lib/shared/bundler/webpack/pluginConfigs/configHtmlWebpackPlugin.js +1 -1
- package/lib/shared/bundler/webpack/pluginConfigs/configI18nSplitPlugin.js +1 -1
- package/lib/shared/bundler/webpack/pluginConfigs/configServiceWorkerPlugin.js +1 -1
- package/lib/shared/bundler/webpack/webpackConfig.js +1 -1
- package/package.json +1 -1
|
@@ -120,6 +120,7 @@ var _default = {
|
|
|
120
120
|
},
|
|
121
121
|
app: {
|
|
122
122
|
entryFile: 'src/index.js',
|
|
123
|
+
entryPointName: 'main',
|
|
123
124
|
tpFolder: null,
|
|
124
125
|
moduleResolvePath: 'node_modules'
|
|
125
126
|
},
|
|
@@ -189,6 +190,7 @@ var _default = {
|
|
|
189
190
|
enable: true
|
|
190
191
|
},
|
|
191
192
|
changeRuntimeChunkChar: '~',
|
|
193
|
+
splitRuntimeChunk: true,
|
|
192
194
|
serviceWorker: {
|
|
193
195
|
enable: false,
|
|
194
196
|
templateFilePath: 'sw.js',
|
|
@@ -200,6 +202,9 @@ var _default = {
|
|
|
200
202
|
fileName: null,
|
|
201
203
|
options: null,
|
|
202
204
|
excludeKeys: null
|
|
205
|
+
},
|
|
206
|
+
optimization: {
|
|
207
|
+
enable: true
|
|
203
208
|
}
|
|
204
209
|
};
|
|
205
210
|
exports.default = _default;
|
|
@@ -15,10 +15,11 @@ function entryConfig(options) {
|
|
|
15
15
|
} = options.efc;
|
|
16
16
|
const {
|
|
17
17
|
entryFile: mainEntry,
|
|
18
|
-
AdditionalEntry
|
|
18
|
+
AdditionalEntry,
|
|
19
|
+
entryPointName: mainEntryPointName = 'main'
|
|
19
20
|
} = options.app;
|
|
20
21
|
const entry = {
|
|
21
|
-
|
|
22
|
+
[mainEntryPointName]: (0, _constants.joinWithAppPath)(mainEntry)
|
|
22
23
|
};
|
|
23
24
|
|
|
24
25
|
if (hasEFC && entryFile) {
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.configHtmlFileLoader = configHtmlFileLoader;
|
|
7
6
|
exports.configHtmlTemplateLoader = configHtmlTemplateLoader;
|
|
8
7
|
|
|
9
8
|
function configHtmlTemplateLoader(options) {
|
|
@@ -16,11 +15,4 @@ function configHtmlTemplateLoader(options) {
|
|
|
16
15
|
}
|
|
17
16
|
}]
|
|
18
17
|
};
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
function configHtmlFileLoader(options) {
|
|
22
|
-
return {
|
|
23
|
-
test: /\.html$/,
|
|
24
|
-
type: 'asset/source'
|
|
25
|
-
};
|
|
26
18
|
}
|
|
@@ -18,6 +18,14 @@ var _splitChunksConfig = require("./splitChunksConfig");
|
|
|
18
18
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
19
|
|
|
20
20
|
function optimizationConfig(options) {
|
|
21
|
+
if (!options.optimization.enable) {
|
|
22
|
+
return {
|
|
23
|
+
minimize: false,
|
|
24
|
+
splitChunks: false,
|
|
25
|
+
runtimeChunk: false
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
|
|
21
29
|
const {
|
|
22
30
|
changeRuntimeChunkChar
|
|
23
31
|
} = options;
|
|
@@ -33,7 +33,7 @@ function configHtmlWebpackPlugin(options) {
|
|
|
33
33
|
const minifyHtmlOptions = (0, _modeUtils.isProductionMode)(mode) ? // eslint-disable-next-line no-use-before-define
|
|
34
34
|
getHTMLMinifyOptions(htmlTemplate) : false;
|
|
35
35
|
return new _InitialHtmlPlugin.InitialHtmlPlugin({
|
|
36
|
-
mainChunkName: 'main',
|
|
36
|
+
mainChunkName: options.app.entryPointName || 'main',
|
|
37
37
|
filename: (0, _nameTemplates.nameTemplates)('html', options),
|
|
38
38
|
template: appInitialHTMLTemplatePath,
|
|
39
39
|
minify: minifyHtmlOptions,
|
|
@@ -25,7 +25,7 @@ function configI18nSplitPlugin(options) {
|
|
|
25
25
|
const i18nPublicPath = (0, _resourceBasedPublicPath.resourceBasedPublicPath)('i18n', options); // const i18nPublicPathAsExpression = publicPathAsExpression('i18n', options);
|
|
26
26
|
|
|
27
27
|
return new _I18nSplitPlugin.default({
|
|
28
|
-
mainChunkName: 'main',
|
|
28
|
+
mainChunkName: options.app.entryPointName || 'main',
|
|
29
29
|
jsResource: i18nChunkSplit.jsResource,
|
|
30
30
|
localeVarName: i18nChunkSplit.localeVarName,
|
|
31
31
|
jsonpFunc: i18nChunkSplit.jsonpFunc,
|
|
@@ -48,7 +48,7 @@ function webpackConfigCreator(options) {
|
|
|
48
48
|
module: {
|
|
49
49
|
/* strictExportPresence for break the build when imported module not present in respective file */
|
|
50
50
|
// strictExportPresence: true,
|
|
51
|
-
rules: [...(0, _jsLoaders.jsLoaders)(options), ...(0, _tsLoaders.tsLoaders)(options), ...(0, _cssLoaders.cssLoaders)(options), (0, _configWebWorkerLoader.configWebWorkerLoader)(options), (0, _configHtmlTemplateLoader.configHtmlTemplateLoader)(options),
|
|
51
|
+
rules: [...(0, _jsLoaders.jsLoaders)(options), ...(0, _tsLoaders.tsLoaders)(options), ...(0, _cssLoaders.cssLoaders)(options), (0, _configWebWorkerLoader.configWebWorkerLoader)(options), (0, _configHtmlTemplateLoader.configHtmlTemplateLoader)(options), ...(0, _assetLoaders.assetLoaders)(options), ...(0, _configCustomLoaders.configCustomLoaders)(options)]
|
|
52
52
|
},
|
|
53
53
|
plugins: (0, _plugins.plugins)(options),
|
|
54
54
|
externals: (0, _externals.externals)(options),
|