@zohodesk/react-cli 0.0.1-beta.16 → 0.0.1-beta.162
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/.eslintignore +1 -0
- package/.eslintrc.js +46 -3
- package/CHANGELOG.md +5 -0
- package/README.md +708 -0
- package/bin/cli.js +134 -27
- package/cert/cert.pem +37 -129
- package/cert/key.pem +27 -27
- package/cert/passphrase.pem +1 -0
- package/files/eslintrc.js +62 -0
- package/files/prettierrc.js +3 -0
- package/lib/babel/cmjs-plugins-presets.js +16 -9
- package/lib/babel/es-plugins-presets.js +26 -14
- package/lib/common/getEntries.js +33 -24
- package/lib/common/getPublicPathConfig.js +40 -0
- package/lib/common/index.js +27 -13
- package/lib/common/splitChunks.js +64 -26
- package/lib/common/sslcertUpdater.js +59 -0
- package/lib/common/templateParameters.js +25 -0
- package/lib/configs/jest.config.js +26 -27
- package/lib/configs/libAlias.js +31 -0
- package/lib/configs/webpack.component.umd.config.js +31 -37
- package/lib/configs/webpack.css.umd.config.js +44 -44
- package/lib/configs/webpack.dev.config.js +96 -56
- package/lib/configs/webpack.docs.config.js +104 -98
- package/lib/configs/webpack.impact.config.js +116 -0
- package/lib/configs/webpack.prod.config.js +137 -85
- package/lib/hooks/docsProptypeHook.js +32 -38
- package/lib/jest/commitedFilesResult.js +144 -71
- package/lib/jest/coverageCollector.js +62 -29
- package/lib/jest/jsonMaker.js +54 -0
- package/lib/jest/preProcessors/cssPreprocessor.js +16 -18
- package/lib/jest/preProcessors/jsPreprocessor.js +5 -6
- package/lib/jest/preProcessors/otherFilesPreprocessor.js +5 -6
- package/lib/jest/result.js +91 -41
- package/lib/jest/run.js +74 -27
- package/lib/jest/setup.js +103 -102
- package/lib/loaderUtils/getCSSLoaders.js +77 -0
- package/lib/loaderUtils/getDevJsLoaders.js +30 -23
- package/lib/loaderUtils/index.js +14 -7
- package/lib/loaders/docsLoader.js +15 -15
- package/lib/loaders/docsPropsLoader.js +14 -17
- package/lib/loaders/fileBountryLoader.js +17 -0
- package/lib/loaders/fileLoader.js +47 -38
- package/lib/loaders/scriptInstrumentLoader.js +21 -20
- package/lib/loaders/selectorMappingLoader.js +75 -0
- package/lib/loaders/workerLoader.js +136 -0
- package/lib/middlewares/HMRMiddleware.js +59 -41
- package/lib/middlewares/SSTMiddleware.js +21 -0
- package/lib/pluginUtils/getDevPlugins.js +175 -26
- package/lib/pluginUtils/getDocsPlugins.js +32 -17
- package/lib/pluginUtils/getLibraryImactPlugins.js +23 -0
- package/lib/pluginUtils/getLibraryPlugins.js +8 -10
- package/lib/pluginUtils/getProdPlugins.js +240 -37
- package/lib/pluginUtils/getServerPlugins.js +8 -11
- package/lib/pluginUtils/getUMDCSSPlugins.js +11 -15
- package/lib/pluginUtils/getUMDComponentPlugins.js +11 -15
- package/lib/pluginUtils/index.js +36 -43
- package/lib/plugins/CdnChangePlugin.js +77 -0
- package/lib/plugins/CleanupStatsPlugin.js +28 -0
- package/lib/plugins/EFCPlugin.js +241 -0
- package/lib/plugins/EFCPlugin.md +6 -0
- package/lib/plugins/EFCTemplatePlugin.js +151 -0
- package/lib/plugins/I18NInjectIntoIndexPlugin.js +141 -0
- package/lib/plugins/I18nSplitPlugin/I18nDebugPlugin.js +60 -0
- package/lib/plugins/I18nSplitPlugin/I18nDependency.js +44 -0
- package/lib/plugins/I18nSplitPlugin/I18nDownlodLogic.js +266 -0
- package/lib/plugins/I18nSplitPlugin/I18nFilesEmitter.js +183 -0
- package/lib/plugins/I18nSplitPlugin/I18nKeysIdentifer.js +100 -0
- package/lib/plugins/I18nSplitPlugin/I18nSplit.md +86 -0
- package/lib/plugins/I18nSplitPlugin/README.md +25 -0
- package/lib/plugins/I18nSplitPlugin/index.js +185 -0
- package/lib/plugins/I18nSplitPlugin/utils/collectI18nKeys.js +64 -0
- package/lib/plugins/I18nSplitPlugin/utils/getI18nFileUrlPathTemplate.js +13 -0
- package/lib/plugins/I18nSplitPlugin/utils/getI18nKeysFormModules.js +26 -0
- package/lib/plugins/I18nSplitPlugin/utils/hashUtils.js +40 -0
- package/lib/plugins/I18nSplitPlugin/utils/index.js +31 -0
- package/lib/plugins/I18nSplitPlugin/utils/propertiesUtils.js +112 -0
- package/lib/plugins/ManifestPlugin.js +59 -62
- package/lib/plugins/ModuleStatsPlugin.js +98 -97
- package/lib/plugins/OptimizeJSPlugin.js +24 -41
- package/lib/plugins/PublicPathCallbackPlugin.js +63 -0
- package/lib/plugins/PublicPathChangePlugin.js +187 -174
- package/lib/plugins/ReportGeneratePlugin.js +181 -0
- package/lib/plugins/RequireVariablePublicPlugin.js +30 -0
- package/lib/plugins/ResourceHintsPlugin.js +53 -35
- package/lib/plugins/RtlSplitPlugin/OverwriteCssPathForRTL.js +80 -0
- package/lib/plugins/RtlSplitPlugin/RtlCssPlugin.js +82 -0
- package/lib/plugins/RtlSplitPlugin/RtrSplit.md +30 -0
- package/lib/plugins/RtlSplitPlugin/replaceCssDirTemplate.js +26 -0
- package/lib/plugins/ScriptInstrumentPlugin.js +22 -37
- package/lib/plugins/ServiceWorkerPlugin.js +107 -0
- package/lib/plugins/ShadowDOMSupportPlugin.js +270 -0
- package/lib/plugins/SourceMapHookPlugin.js +25 -31
- package/lib/plugins/TPHashMappingPlugin.js +67 -0
- package/lib/plugins/UglifyCSSPlugin.js +23 -30
- package/lib/plugins/UnusedFilesFindPlugin.js +150 -97
- package/lib/plugins/index.js +118 -55
- package/lib/plugins/libraryImpactPlugin.js +190 -0
- package/lib/plugins/webpackwatchrunplugin.js +26 -0
- package/lib/postcss-plugins/ExcludeRTLPlugin.js +23 -0
- package/lib/postcss-plugins/RTLSplitPlugin.js +138 -0
- package/lib/schemas/index.js +466 -52
- package/lib/servers/clusterHubServer.js +22 -26
- package/lib/servers/docsServer.js +3 -5
- package/lib/servers/docsServerCore.js +93 -85
- package/lib/servers/helpServer.js +19 -21
- package/lib/servers/httpsOptions.js +19 -0
- package/lib/servers/impactServer.js +99 -92
- package/lib/servers/mockserver.js +44 -0
- package/lib/servers/nowatchserver.js +275 -0
- package/lib/servers/scrServer.js +147 -0
- package/lib/servers/server.js +118 -124
- package/lib/servers/ssServer.js +107 -65
- package/lib/sh/reportPublish.sh +16 -10
- package/lib/templates/CoverageScriptTemplate.js +45 -18
- package/lib/templates/WMSTemplate.js +17 -18
- package/lib/templates/linterConstant.js +10 -0
- package/lib/utils/babelPresets.js +12 -5
- package/lib/utils/buildstats.html +148 -0
- package/lib/utils/clean.js +12 -11
- package/lib/utils/copy.js +13 -127
- package/lib/utils/copyTimezones.js +21 -0
- package/lib/utils/createEventStream.js +24 -19
- package/lib/utils/cssClassNameGenerate.js +77 -0
- package/lib/utils/cssURLReplacer.js +67 -54
- package/lib/utils/dependencyPostPublish.js +42 -0
- package/lib/utils/fileUtils.js +125 -0
- package/lib/utils/folderIterator.js +47 -0
- package/lib/utils/getComponents.js +126 -0
- package/lib/utils/getCurrentBranch.js +11 -17
- package/lib/utils/getDependenciesImpactList.js +151 -0
- package/lib/utils/getHash.js +26 -0
- package/lib/utils/getIp.js +20 -0
- package/lib/utils/getOptions.js +55 -30
- package/lib/utils/getServerURL.js +25 -8
- package/lib/utils/index.js +259 -82
- package/lib/utils/init.js +2 -2
- package/lib/utils/initPreCommitHook.js +40 -31
- package/lib/utils/jsonHelper.js +97 -0
- package/lib/utils/libraryImpactConfig.js +63 -0
- package/lib/utils/lint/addScripts.js +27 -0
- package/lib/utils/lint/checkExistingConfig.js +67 -0
- package/lib/utils/lint/copyConfigs.js +24 -0
- package/lib/utils/lint/index.js +54 -0
- package/lib/utils/lint/lintScripts.js +11 -0
- package/lib/utils/lint/lintSetup.js +31 -0
- package/lib/utils/lint/lintStagedPreCommitHook.js +7 -0
- package/lib/utils/lint/question.js +30 -0
- package/lib/utils/lintReporter.js +142 -0
- package/lib/utils/mailSender.js +16 -25
- package/lib/utils/pullOrigin.js +28 -0
- package/lib/utils/reinstallDependencies.js +133 -0
- package/lib/utils/removeAttributes.js +25 -23
- package/lib/utils/repoClone.js +56 -63
- package/lib/utils/request.js +64 -77
- package/lib/utils/resultSchema.json +73 -0
- package/lib/utils/rtl.js +42 -0
- package/lib/utils/setEnvVariables.js +5 -6
- package/lib/utils/ssTestHack.js +48 -0
- package/lib/utils/switchBranch.js +28 -0
- package/lib/utils/urlConcat.js +22 -0
- package/package.json +92 -64
- package/templates/app/.eslintrc.js +140 -0
- package/templates/app/README.md +12 -12
- package/templates/app/app/index.html +24 -8
- package/templates/app/app/properties/ApplicationResources_en_US.properties +1 -1
- package/templates/app/app/properties/i18nkeys.json +3 -3
- package/templates/app/docs/all.html +69 -69
- package/templates/app/mockapi/index.js +18 -13
- package/templates/app/package.json +37 -17
- package/templates/app/src/actions/SampleActions/index.js +37 -0
- package/templates/app/src/actions/index.js +65 -0
- package/templates/app/src/appUrls.js +19 -0
- package/templates/app/src/components/Alert/Alert.js +134 -0
- package/templates/app/src/components/Alert/Alert.module.css +79 -0
- package/templates/app/src/components/FreezeLayer/FreezeLayer.css +37 -0
- package/templates/app/src/components/FreezeLayer/FreezeLayer.js +84 -0
- package/templates/app/src/components/Sample/Sample.module.css +11 -0
- package/templates/app/src/components/Sample/SampleList.js +61 -0
- package/templates/app/src/components/Slider/Slider.css +41 -0
- package/templates/app/src/components/Slider/Slider.js +55 -0
- package/templates/app/src/containers/AlertContainer/index.js +15 -0
- package/templates/app/src/containers/AppContainer/index.js +96 -0
- package/templates/app/src/containers/AppContainer/index.module.css +27 -0
- package/templates/app/src/containers/CustomMatch/index.js +65 -0
- package/templates/app/src/containers/DevTools/index.js +10 -0
- package/templates/app/src/containers/Header/index.js +67 -0
- package/templates/app/src/containers/Header/index.module.css +43 -0
- package/templates/app/src/containers/Redirect/index.js +63 -0
- package/templates/app/src/containers/Redirector/index.js +47 -0
- package/templates/app/src/containers/SampleListContainer/ListContainer.js +42 -0
- package/templates/app/src/containers/SampleListContainer/ListContainer.module.css +3 -0
- package/templates/app/src/historyChange.js +5 -0
- package/templates/app/src/index.html +10 -0
- package/templates/app/src/index.js +24 -0
- package/templates/app/src/middleware/PromiseMiddleware.js +59 -0
- package/templates/app/src/reducers/alertData.js +11 -0
- package/templates/app/src/reducers/index.js +6 -0
- package/templates/app/src/reducers/samples.js +19 -0
- package/templates/app/src/store/configureStore.dev.js +51 -0
- package/templates/app/src/store/configureStore.js +5 -0
- package/templates/app/src/store/configureStore.prod.js +26 -0
- package/templates/app/src/util/Common.js +5 -0
- package/templates/app/src/util/RequestAPI.js +132 -0
- package/templates/appold/README.md +12 -0
- package/templates/appold/app/index.html +8 -0
- package/templates/appold/app/properties/ApplicationResources_en_US.properties +1 -0
- package/templates/appold/app/properties/i18nkeys.json +3 -0
- package/templates/appold/docs/all.html +69 -0
- package/templates/appold/mockapi/index.js +13 -0
- package/templates/{app → appold}/mockapi/tickets.json +0 -0
- package/templates/appold/package.json +17 -0
- package/templates/appold/src/components/Text/Text.css +0 -0
- package/templates/appold/src/components/Text/Text.js +23 -0
- package/templates/appold/src/components/Text/__tests__/Text.spec.js +30 -0
- package/templates/appold/src/components/Text/docs/Text__default.docs.js +16 -0
- package/templates/appold/src/components/docs.js +1 -0
- package/templates/appold/src/components/index.js +5 -0
- package/templates/appold/src/index.js +13 -0
- package/templates/docs/all.html +1 -1
- package/templates/docs/component.html +110 -69
- package/templates/docs/components.html +221 -0
- package/templates/docs/css/component.css +12 -14
- package/templates/docs/css/componentTest.css +7 -0
- package/templates/docs/css/style.css +150 -206
- package/templates/docs/impactReportTemplate.html +154 -0
- package/templates/docs/index.html +1482 -1336
- package/templates/library/src/index.js +0 -0
@@ -1,60 +1,209 @@
|
|
1
|
-
|
1
|
+
"use strict";
|
2
2
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
4
4
|
value: true
|
5
5
|
});
|
6
|
+
exports.default = void 0;
|
6
7
|
|
7
|
-
var _path = require(
|
8
|
+
var _path = _interopRequireDefault(require("path"));
|
8
9
|
|
9
|
-
var
|
10
|
+
var _fs = _interopRequireDefault(require("fs"));
|
10
11
|
|
11
|
-
var _caseSensitivePathsWebpackPlugin = require(
|
12
|
+
var _caseSensitivePathsWebpackPlugin = _interopRequireDefault(require("case-sensitive-paths-webpack-plugin"));
|
12
13
|
|
13
|
-
var
|
14
|
+
var _lodashWebpackPlugin = _interopRequireDefault(require("lodash-webpack-plugin"));
|
14
15
|
|
15
|
-
var _miniCssExtractPlugin = require(
|
16
|
+
var _miniCssExtractPlugin = _interopRequireDefault(require("mini-css-extract-plugin"));
|
16
17
|
|
17
|
-
var
|
18
|
+
var _htmlWebpackPlugin = _interopRequireDefault(require("html-webpack-plugin"));
|
18
19
|
|
19
|
-
var
|
20
|
+
var _htmlWebpackInjectAttributesPlugin = _interopRequireDefault(require("html-webpack-inject-attributes-plugin"));
|
20
21
|
|
21
|
-
var
|
22
|
+
var _I18nSplitPlugin = _interopRequireDefault(require("../plugins/I18nSplitPlugin"));
|
22
23
|
|
23
|
-
var
|
24
|
+
var _RequireVariablePublicPlugin = _interopRequireDefault(require("../plugins/RequireVariablePublicPlugin"));
|
24
25
|
|
25
|
-
|
26
|
+
var _copyWebpackPlugin = _interopRequireDefault(require("copy-webpack-plugin"));
|
27
|
+
|
28
|
+
var _webpack = _interopRequireDefault(require("webpack"));
|
29
|
+
|
30
|
+
var _plugins = require("../plugins");
|
26
31
|
|
27
|
-
var
|
28
|
-
var _options$app = options.app,
|
29
|
-
folder = _options$app.folder,
|
30
|
-
instrumentScript = _options$app.instrumentScript,
|
31
|
-
unusedFiles = options.unusedFiles;
|
32
|
+
var _common = require("../common");
|
32
33
|
|
34
|
+
var _RtlCssPlugin = require("../plugins/RtlSplitPlugin/RtlCssPlugin");
|
33
35
|
|
34
|
-
|
36
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
37
|
+
|
38
|
+
let getDevPlugins = (options, publicPath) => {
|
39
|
+
let {
|
40
|
+
app: {
|
41
|
+
tpFolder,
|
42
|
+
folder,
|
43
|
+
instrumentScript,
|
44
|
+
devCssFileBountry,
|
45
|
+
context,
|
46
|
+
hasEFC: prevOptionForEnableEFC,
|
47
|
+
hasShadowDOM,
|
48
|
+
server: {
|
49
|
+
mode
|
50
|
+
},
|
51
|
+
htmlTemplate: {
|
52
|
+
inject
|
53
|
+
},
|
54
|
+
crossorigin
|
55
|
+
},
|
56
|
+
efc: {
|
57
|
+
hasEFC: newOptionForEnableEFC,
|
58
|
+
templateFilePath,
|
59
|
+
nameScope: efcNameSpace,
|
60
|
+
localeAttr: efcLocaleAttr
|
61
|
+
},
|
62
|
+
css: {
|
63
|
+
enableRTLSplit
|
64
|
+
},
|
65
|
+
i18n,
|
66
|
+
unusedFiles
|
67
|
+
} = options;
|
68
|
+
const hasEFC = newOptionForEnableEFC || prevOptionForEnableEFC;
|
69
|
+
const cssLTRFileNameTempalte = enableRTLSplit ? 'css/[name].ltr.css' : 'css/[name].css';
|
70
|
+
const cssRTLFileNameTempalte = 'css/[name].rtl.css';
|
71
|
+
let plugins = [new _plugins.CleanUpStatsPlugin(), new _caseSensitivePathsWebpackPlugin.default(), new _webpack.default.IgnorePlugin(/^\.\/domain$/, /moment$/), new _webpack.default.DefinePlugin({
|
35
72
|
__CLIENT__: true,
|
36
73
|
__TEST__: false,
|
37
74
|
__SERVER__: false,
|
38
75
|
__DEVELOPMENT__: true,
|
39
76
|
__LOCAL_PRODUCTION__: false,
|
40
77
|
__DEVTOOLS__: true,
|
41
|
-
__DOCS__: false
|
42
|
-
|
43
|
-
|
44
|
-
|
78
|
+
__DOCS__: false,
|
79
|
+
'process.env': {
|
80
|
+
NODE_ENV: JSON.stringify(mode === 'dev-no-warn' ? 'production' : 'development')
|
81
|
+
}
|
82
|
+
}), new _miniCssExtractPlugin.default({
|
83
|
+
filename: cssLTRFileNameTempalte,
|
84
|
+
// ignoreOrder: true,
|
85
|
+
chunkFilename: cssLTRFileNameTempalte
|
45
86
|
}), new _plugins.ResourceHintsPlugin()];
|
46
87
|
|
88
|
+
if (enableRTLSplit) {
|
89
|
+
plugins.push(new _RtlCssPlugin.RtlCssPlugin({
|
90
|
+
templateLabel: options.css.templateLabel,
|
91
|
+
dirVarName: options.css.dirVarName,
|
92
|
+
disableMiniFiySelector: options.css.disableMiniFiySelector,
|
93
|
+
// config: {},
|
94
|
+
// sourcemap: true,
|
95
|
+
filename: cssRTLFileNameTempalte
|
96
|
+
}));
|
97
|
+
}
|
98
|
+
|
47
99
|
if (unusedFiles.enable) {
|
48
100
|
plugins.push(new _plugins.UnusedFilesFindPlugin(Object.assign(unusedFiles, {
|
49
|
-
origin:
|
101
|
+
origin: _path.default.join(process.cwd(), folder)
|
50
102
|
})));
|
51
103
|
}
|
52
104
|
|
53
|
-
|
54
|
-
|
105
|
+
const i18nManifestFileName = 'i18n-manifest.json';
|
106
|
+
/**
|
107
|
+
* NOTE:
|
108
|
+
* this file name ext .i18n.js added
|
109
|
+
* Because, in service worker they maintain cache as file name based
|
110
|
+
* So, to make differce we added .i18n.js ext.
|
111
|
+
*/
|
112
|
+
|
113
|
+
const i18nFileNameTemplate = 'i18n-chunk/[locale]/[name].i18n.js';
|
114
|
+
const i18nPublicPath = publicPath || '';
|
115
|
+
|
116
|
+
if (i18n.chunkSplitEnable) {
|
117
|
+
plugins.push(new _I18nSplitPlugin.default({
|
118
|
+
jsResource: i18n.jsResource,
|
119
|
+
localeVarName: i18n.localeVarName,
|
120
|
+
jsonpFunc: i18n.jsonpFunc,
|
121
|
+
disableDefault: i18n.disableDefault,
|
122
|
+
publicPath: i18nPublicPath,
|
123
|
+
i18nManifestFileName,
|
124
|
+
// template: (object, locale) => `window.loadI18n(${JSON.stringify(object)}, ${JSON.stringify(locale)})`,
|
125
|
+
filenameTemplate: i18nFileNameTemplate,
|
126
|
+
propertiesFolder: i18n.propertiesFolder
|
127
|
+
}));
|
128
|
+
} else {
|
129
|
+
let i18nPath = _path.default.join(process.cwd(), context, 'i18n');
|
130
|
+
|
131
|
+
if (_fs.default.existsSync(i18nPath)) {
|
132
|
+
plugins.push(new _copyWebpackPlugin.default([{
|
133
|
+
from: `${i18nPath}/`,
|
134
|
+
to: './i18n/[name].[ext]',
|
135
|
+
toType: 'template'
|
136
|
+
}]));
|
137
|
+
}
|
138
|
+
}
|
139
|
+
|
140
|
+
tpFolder && plugins.push(new _copyWebpackPlugin.default([{
|
141
|
+
from: `${_path.default.join(process.cwd(), context, tpFolder)}/`,
|
142
|
+
to: `./${tpFolder}/`,
|
143
|
+
toType: 'dir'
|
144
|
+
}]));
|
145
|
+
plugins.push(new _lodashWebpackPlugin.default({
|
146
|
+
collections: true,
|
147
|
+
shorthands: true
|
148
|
+
}));
|
149
|
+
|
150
|
+
if (hasEFC) {
|
151
|
+
plugins.push(new _htmlWebpackPlugin.default({
|
152
|
+
chunksSortMode: 'none',
|
153
|
+
filename: 'index.html',
|
154
|
+
template: _path.default.join(process.cwd(), folder, 'index.html'),
|
155
|
+
excludeChunks: ['efc', 'widget'],
|
156
|
+
templateParameters: _common.templateParameters,
|
157
|
+
scriptLoading: 'defer',
|
158
|
+
inject: inject
|
159
|
+
}));
|
160
|
+
crossorigin && plugins.push(new _htmlWebpackInjectAttributesPlugin.default({
|
161
|
+
crossorigin: 'anonymous'
|
162
|
+
}));
|
163
|
+
plugins.push(new _plugins.EFCPlugin({
|
164
|
+
isDevelopment: true,
|
165
|
+
i18nManifestFileName,
|
166
|
+
templateFilePath,
|
167
|
+
i18nFileNameTemplate,
|
168
|
+
serverUrl: publicPath,
|
169
|
+
entryPointName: 'efc',
|
170
|
+
nameScope: efcNameSpace,
|
171
|
+
localeAttr: efcLocaleAttr // outputFile: 'zohodesk-efc-sdk-latest.js',
|
172
|
+
|
173
|
+
}));
|
174
|
+
} else {
|
175
|
+
plugins.push(new _htmlWebpackPlugin.default({
|
176
|
+
chunksSortMode: 'none',
|
177
|
+
filename: 'index.html',
|
178
|
+
template: _path.default.join(process.cwd(), folder, 'index.html'),
|
179
|
+
templateParameters: _common.templateParameters,
|
180
|
+
scriptLoading: 'defer',
|
181
|
+
inject: inject
|
182
|
+
}));
|
183
|
+
crossorigin && plugins.push(new _htmlWebpackInjectAttributesPlugin.default({
|
184
|
+
crossorigin: 'anonymous'
|
185
|
+
}));
|
186
|
+
}
|
187
|
+
|
188
|
+
plugins.push(new _plugins.I18NInjectIntoIndexPlugin({
|
189
|
+
publicPath: i18nPublicPath,
|
190
|
+
isDevelopment: true,
|
191
|
+
templateLabel: i18n.templateLabel || '{{--user-locale}}',
|
192
|
+
i18nFileNameTemplate,
|
193
|
+
i18nManifestFileName,
|
194
|
+
mainChunkName: 'main'
|
195
|
+
}));
|
196
|
+
instrumentScript && plugins.push(new _plugins.ScriptInstrumentPlugin());
|
197
|
+
hasShadowDOM && plugins.push(new _plugins.ShadowDOMSupportPlugin());
|
198
|
+
|
199
|
+
if (devCssFileBountry) {
|
200
|
+
plugins.push(new _RequireVariablePublicPlugin.default({
|
201
|
+
requireFuncName: 'require'
|
202
|
+
}));
|
55
203
|
}
|
56
204
|
|
57
|
-
return plugins;
|
205
|
+
return plugins.filter(Boolean);
|
58
206
|
};
|
59
207
|
|
60
|
-
|
208
|
+
var _default = getDevPlugins;
|
209
|
+
exports.default = _default;
|
@@ -1,39 +1,54 @@
|
|
1
|
-
|
1
|
+
"use strict";
|
2
2
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
4
4
|
value: true
|
5
5
|
});
|
6
|
+
exports.default = void 0;
|
6
7
|
|
7
|
-
var _caseSensitivePathsWebpackPlugin = require(
|
8
|
+
var _caseSensitivePathsWebpackPlugin = _interopRequireDefault(require("case-sensitive-paths-webpack-plugin"));
|
8
9
|
|
9
|
-
var
|
10
|
+
var _miniCssExtractPlugin = _interopRequireDefault(require("mini-css-extract-plugin"));
|
10
11
|
|
11
|
-
var
|
12
|
+
var _webpack = _interopRequireDefault(require("webpack"));
|
12
13
|
|
13
|
-
var
|
14
|
+
var _path = _interopRequireDefault(require("path"));
|
14
15
|
|
15
|
-
var
|
16
|
-
|
17
|
-
var _webpack2 = _interopRequireDefault(_webpack);
|
18
|
-
|
19
|
-
var _ModuleStatsPlugin = require('../plugins/ModuleStatsPlugin');
|
20
|
-
|
21
|
-
var _ModuleStatsPlugin2 = _interopRequireDefault(_ModuleStatsPlugin);
|
16
|
+
var _plugins = require("../plugins");
|
22
17
|
|
23
18
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
24
19
|
|
25
|
-
|
26
|
-
|
20
|
+
// isForLibraryImpact this variable for now only used in getLibraryImactPlugins.
|
21
|
+
// So you gona use it please check with that function as well
|
22
|
+
let getDocsPlugins = (isSSTest, options, isForLibraryImpact = false) => {
|
23
|
+
let {
|
24
|
+
app: {
|
25
|
+
folder
|
26
|
+
},
|
27
|
+
unusedFiles
|
28
|
+
} = options;
|
29
|
+
let plugins = [new _plugins.CleanUpStatsPlugin(), new _caseSensitivePathsWebpackPlugin.default(), new _webpack.default.ProvidePlugin({
|
27
30
|
React: 'react'
|
28
|
-
}), new
|
31
|
+
}), new _webpack.default.DefinePlugin({
|
29
32
|
__TEST__: false,
|
30
33
|
__DEVELOPMENT__: true,
|
31
34
|
__DOCS__: true
|
32
|
-
}),
|
35
|
+
}), !isForLibraryImpact && new _plugins.ModuleStatsPlugin({
|
36
|
+
filename: 'js/moduleStats.js'
|
37
|
+
}), new _miniCssExtractPlugin.default({
|
33
38
|
filename: 'css/[name].css',
|
34
39
|
chunkFilename: 'css/[name].css'
|
35
40
|
})].filter(Boolean);
|
41
|
+
|
42
|
+
if (unusedFiles.enable) {
|
43
|
+
plugins.push(new _plugins.UnusedFilesFindPlugin(Object.assign(unusedFiles, {
|
44
|
+
docsFilename: 'Undocsfiles.json',
|
45
|
+
ssTest: true,
|
46
|
+
origin: _path.default.join(process.cwd(), folder)
|
47
|
+
})));
|
48
|
+
}
|
49
|
+
|
36
50
|
return plugins;
|
37
51
|
};
|
38
52
|
|
39
|
-
|
53
|
+
var _default = getDocsPlugins;
|
54
|
+
exports.default = _default;
|
@@ -0,0 +1,23 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.default = getLibraryImactPlugins;
|
7
|
+
|
8
|
+
var _libraryImpactPlugin = _interopRequireDefault(require("../plugins/libraryImpactPlugin"));
|
9
|
+
|
10
|
+
var _getDocsPlugins = _interopRequireDefault(require("./getDocsPlugins"));
|
11
|
+
|
12
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
13
|
+
|
14
|
+
// import ModuleStatsPlugin from '../plugins/ModuleStatsPlugin';
|
15
|
+
function getLibraryImactPlugins(options) {
|
16
|
+
let plugins = (0, _getDocsPlugins.default)(false, options, true); // for performance But for furture maintanablity we adding isForLibraryImpact in getDocsPlugin
|
17
|
+
// plugins.filter(plugin => !(plugin instanceof ModuleStatsPlugin));
|
18
|
+
|
19
|
+
plugins.push(new _libraryImpactPlugin.default({
|
20
|
+
filename: 'js/libraryImpact.js'
|
21
|
+
}));
|
22
|
+
return plugins;
|
23
|
+
}
|
@@ -1,21 +1,18 @@
|
|
1
|
-
|
1
|
+
"use strict";
|
2
2
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
4
4
|
value: true
|
5
5
|
});
|
6
|
+
exports.default = void 0;
|
6
7
|
|
7
|
-
var _caseSensitivePathsWebpackPlugin = require(
|
8
|
+
var _caseSensitivePathsWebpackPlugin = _interopRequireDefault(require("case-sensitive-paths-webpack-plugin"));
|
8
9
|
|
9
|
-
var
|
10
|
-
|
11
|
-
var _webpack = require('webpack');
|
12
|
-
|
13
|
-
var _webpack2 = _interopRequireDefault(_webpack);
|
10
|
+
var _webpack = _interopRequireDefault(require("webpack"));
|
14
11
|
|
15
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
16
13
|
|
17
|
-
|
18
|
-
|
14
|
+
let getLibraryPlugins = () => {
|
15
|
+
let plugins = [new _caseSensitivePathsWebpackPlugin.default(), new _webpack.default.DefinePlugin({
|
19
16
|
__TEST__: false,
|
20
17
|
__DEVELOPMENT__: false,
|
21
18
|
__DOCS__: false,
|
@@ -27,4 +24,5 @@ var getLibraryPlugins = function getLibraryPlugins() {
|
|
27
24
|
return plugins;
|
28
25
|
};
|
29
26
|
|
30
|
-
|
27
|
+
var _default = getLibraryPlugins;
|
28
|
+
exports.default = _default;
|