@zohodesk/react-cli 0.0.1-exp.161.3 → 0.0.1-exp.162.2
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/.eslintrc.js +1 -1
- package/README.md +81 -9
- package/bin/cli.js +50 -2
- package/eslint/NOTES.md +3 -0
- package/eslint/mockapi.html +18 -0
- package/eslint/mockapi.md +5 -0
- package/lib/common/index.js +6 -6
- package/lib/configs/jest.config.js +12 -3
- package/lib/configs/libAlias.js +31 -0
- package/lib/configs/webpack.dev.config.js +6 -19
- package/lib/configs/webpack.prod.config.js +30 -23
- package/lib/loaderUtils/index.js +4 -4
- package/lib/pluginUtils/getDevPlugins.js +2 -0
- package/lib/pluginUtils/getProdPlugins.js +11 -3
- package/lib/pluginUtils/index.js +12 -12
- package/lib/plugins/EFCPlugin.js +43 -13
- package/lib/plugins/EFCTemplatePlugin.js +151 -0
- package/lib/plugins/I18nSplitPlugin/utils/hashUtils.js +2 -2
- package/lib/plugins/I18nSplitPlugin/utils/propertiesUtils.js +1 -1
- package/lib/plugins/ManifestPlugin.js +8 -0
- package/lib/plugins/index.js +36 -36
- package/lib/postcss-plugins/RTLSplitPlugin.js +1 -1
- package/lib/schemas/index.js +9 -0
- package/lib/templates/linterConstant.js +1 -1
- package/lib/utils/cssClassNameGenerate.js +9 -2
- package/lib/utils/cssURLReplacer.js +1 -1
- package/lib/utils/getCurrentBranch.js +1 -1
- package/lib/utils/getOptions.js +52 -0
- package/lib/utils/index.js +21 -19
- package/lib/utils/jsonHelper.js +1 -1
- package/lib/utils/reinstallDependencies.js +1 -1
- package/log.log +702 -0
- package/package.json +9 -4
package/.eslintrc.js
CHANGED
@@ -108,7 +108,7 @@ let commonConfigs = {
|
|
108
108
|
'comma-dangle': [logLevel],
|
109
109
|
'comma-spacing': [logLevel],
|
110
110
|
'func-call-spacing': [logLevel],
|
111
|
-
indent: [
|
111
|
+
indent: ['off', 2, { SwitchCase: 1 }],
|
112
112
|
'jsx-quotes': [logLevel, 'prefer-single'],
|
113
113
|
'key-spacing': [logLevel],
|
114
114
|
'keyword-spacing': [logLevel],
|
package/README.md
CHANGED
@@ -1,39 +1,111 @@
|
|
1
1
|
# React CLI
|
2
2
|
|
3
3
|
A CLI tool for build modern web application and libraries
|
4
|
+
|
5
|
+
# 0.0.1-exp.162.2
|
6
|
+
|
7
|
+
- **Optimazation:-**
|
8
|
+
- double time minimize optimazation
|
9
|
+
|
10
|
+
# 0.0.1-beta.162.1
|
11
|
+
|
12
|
+
- **Issue Fix:-**
|
13
|
+
- if git not installed react-cli throws error for any command due to `getCurrentBranch` in `shemas/index.js` now fixed
|
14
|
+
|
15
|
+
# 0.0.1-beta.161.1
|
16
|
+
|
17
|
+
- **Features :-**
|
18
|
+
- feature added for pre process logic
|
19
|
+
- tailer made requirement for preprocess, just write node js file
|
20
|
+
- mention file in `"react-cli" => "preprocess" => "runner"`
|
21
|
+
- option parse logic added for react-cli (exprimental)
|
22
|
+
|
23
|
+
# 0.0.1-beta.161
|
24
|
+
|
25
|
+
- **Features :-**
|
26
|
+
- feature added for efc `templateFilePath` in `package.json` option palce is `"react-cli" => "efc" => "templateFilePath"`
|
27
|
+
- `(('publicPath'))` this placeholder will be replace as publicPath string `publicPath`
|
28
|
+
- `(('getInitalAssets'))` this placeholder will be replace as function `getInitalAssets`
|
29
|
+
- `getInitalAssets` this function has two arguments `assetsType`, `lang`
|
30
|
+
- `assetsType` are `js`, `css`, `i18n`
|
31
|
+
- `lang` this argument only works when `i18n` is `assetsType`
|
32
|
+
- feature added for efc `cdnStatement`
|
33
|
+
- **Issue fixes:-**
|
34
|
+
- css classname hash change issue fix
|
35
|
+
- debug package conflit issue fix in nock in (react-cli test)
|
36
|
+
- manifest.json css file name correction issue for rtl and ltr
|
37
|
+
|
38
|
+
# 0.0.1-exp.161.2
|
39
|
+
|
40
|
+
- Features
|
41
|
+
- feature added for efc `templateFilePath` in `package.json` option palce is `"react-cli" => "efc" `
|
42
|
+
- `(('publicPath'))` this placeholder will be replace as publicPath string `publicPath`
|
43
|
+
- `(('getInitalAssets'))` this placeholder will be replace as function `getInitalAssets`
|
44
|
+
- `getInitalAssets` this function has two arguments `assetsType`, `lang`
|
45
|
+
- `assetsType` are `js`, `css`, `i18n`
|
46
|
+
- `lang` this argument only works when `i18n` is `assetsType`
|
47
|
+
|
48
|
+
# 0.0.1-exp.161.1
|
49
|
+
|
50
|
+
- Features
|
51
|
+
- feature added for efc `cdnStatement`
|
52
|
+
- Issue fixes:-
|
53
|
+
- css classname hash change issue fix
|
54
|
+
- debug package conflit issue fix in nock in (react-cli test)npm i @zohodesk/virtualizer
|
55
|
+
- manifest.json css file name correction issue for rtl and ltr
|
56
|
+
|
4
57
|
# 0.0.1-beta.160
|
58
|
+
|
5
59
|
- @zohodesk/normalizer package version updated to 1.0.2
|
60
|
+
|
6
61
|
# 0.0.1-beta.159
|
62
|
+
|
7
63
|
- @zohodesk/datetimejs package updated to beta.7
|
64
|
+
|
65
|
+
# 0.0.1-exp.159
|
66
|
+
|
67
|
+
- isse fix:-
|
68
|
+
- when rtl ltr css split enable manifest json css filename keys comes with hash .
|
69
|
+
|
8
70
|
# 0.0.1-beta.158
|
9
|
-
|
71
|
+
|
72
|
+
- Removing source map files from service worker caching.
|
73
|
+
|
10
74
|
# 0.0.1-beta.157
|
11
|
-
|
75
|
+
|
76
|
+
- Experimental version issue fix(Dummy version removed)
|
77
|
+
|
12
78
|
# 0.0.1-beta.156
|
13
|
-
|
79
|
+
|
80
|
+
- ReportPublish issue fix
|
14
81
|
|
15
82
|
# 0.0.1-beta.155
|
16
|
-
|
83
|
+
|
84
|
+
- get impacted library source files option added
|
17
85
|
|
18
86
|
# 0.0.1-beta.154
|
19
|
-
|
20
|
-
|
21
|
-
|
87
|
+
|
88
|
+
- mockPrefix option for mock url prefix change
|
89
|
+
- Issue fix:-
|
90
|
+
- un wanted {{--js-smap}} in inital html without enable smap in build
|
22
91
|
|
23
92
|
# 0.0.1-beta.153
|
93
|
+
|
24
94
|
- Vendor include array added
|
25
95
|
- If you need to include any thrid party js in vendor we can use this array
|
26
96
|
|
27
97
|
# 0.0.1-beta.152
|
98
|
+
|
28
99
|
impact servise related changes:-
|
100
|
+
|
29
101
|
- nowatchstart option added. will be used like `react-cli nowatchstart <...options>` this will be used for src file changes no need to reflect (or no need to rebulid on file changes)
|
30
102
|
- cssselector_zip option added. will be used like `--cssselector-zip=selectormapping.zip`
|
31
103
|
only work in two ways
|
32
104
|
1. `react-cli start --disable-watch --cssselector-zip=selectormapping.zip` app start command with `--disable-watch` flag and your usaul options
|
33
105
|
2. `react-cli nowatchstart --cssselector-zip=selectormapping.zip` app start command's usaul options
|
34
106
|
#### Urls are:-
|
35
|
-
Below express path are added, For download zip files and
|
36
|
-
- `/zips/${zipname}.zip`
|
107
|
+
Below express path are added, For download zip files and
|
108
|
+
- `/zips/${zipname}.zip` for css selector maps zip file (contains css_map filies and original css files)
|
37
109
|
- `/zips/build.zip` build zip file (contains bundled all files)
|
38
110
|
|
39
111
|
# 0.0.1-beta.151
|
package/bin/cli.js
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
let path = require('path');
|
4
4
|
let os = require('os');
|
5
|
-
let { spawnSync } = require('child_process');
|
5
|
+
let { spawnSync, spawn } = require('child_process');
|
6
6
|
let { getOptions } = require('../lib/utils/index.js');
|
7
7
|
|
8
8
|
let { log } = require('../lib/utils');
|
@@ -42,8 +42,53 @@ let babel = getCliPath('babel');
|
|
42
42
|
let propertyToJson = getCliPath('propertyToJson');
|
43
43
|
let esLint = getCliPath('eslint');
|
44
44
|
|
45
|
+
let preprocesserPath = options.preprocessor.runner
|
46
|
+
? path.join(process.cwd(), options.preprocessor.runner)
|
47
|
+
: '';
|
48
|
+
|
49
|
+
// console.log(
|
50
|
+
// 'options.app.preprocessor',
|
51
|
+
// options.preprocessor.runner,
|
52
|
+
// preprocesserPath
|
53
|
+
// );
|
54
|
+
if (preprocesserPath) {
|
55
|
+
// eslint-disable-next-line default-case
|
56
|
+
switch (option) {
|
57
|
+
case 'start':
|
58
|
+
case 'docs':
|
59
|
+
spawn(nodemon, [preprocesserPath], {
|
60
|
+
stdio: 'inherit',
|
61
|
+
cwd: preprocesserPath.slice(0, preprocesserPath.lastIndexOf('/') + 1)
|
62
|
+
});
|
63
|
+
// NOTE: it's ok if we not close this here
|
64
|
+
// Because when node server stops this program willbe closed So this nodemon will be killed as well
|
65
|
+
break;
|
66
|
+
case 'nowatchstart':
|
67
|
+
case 'build:library:es':
|
68
|
+
case 'build:component:es':
|
69
|
+
case 'build:library:cmjs':
|
70
|
+
case 'build:component:cmjs':
|
71
|
+
spawnSync('node', [preprocesserPath], {
|
72
|
+
stdio: 'inherit',
|
73
|
+
cwd: preprocesserPath.slice(0, preprocesserPath.lastIndexOf('/') + 1)
|
74
|
+
});
|
75
|
+
break;
|
76
|
+
}
|
77
|
+
}
|
78
|
+
|
45
79
|
let result;
|
46
80
|
switch (option) {
|
81
|
+
case 'preprocessor':
|
82
|
+
if (preprocesserPath) {
|
83
|
+
result = spawnSync(nodemon, [preprocesserPath], {
|
84
|
+
stdio: 'inherit',
|
85
|
+
cwd: preprocesserPath.slice(0, preprocesserPath.lastIndexOf('/') + 1)
|
86
|
+
});
|
87
|
+
process.exit(result.status);
|
88
|
+
} else {
|
89
|
+
console.error('preProcessor not exists ');
|
90
|
+
}
|
91
|
+
break;
|
47
92
|
case 'lint-setup': {
|
48
93
|
result = spawnSync(
|
49
94
|
'node',
|
@@ -219,11 +264,14 @@ switch (option) {
|
|
219
264
|
webpack,
|
220
265
|
[
|
221
266
|
'--config',
|
222
|
-
require.resolve('../lib/configs/webpack.prod.config.js')
|
267
|
+
require.resolve('../lib/configs/webpack.prod.config.js'),
|
268
|
+
'--progress',
|
269
|
+
'--profile'
|
223
270
|
].concat(args),
|
224
271
|
{ stdio: 'inherit' }
|
225
272
|
);
|
226
273
|
|
274
|
+
// console.log(result);
|
227
275
|
process.exit(result.status);
|
228
276
|
break;
|
229
277
|
|
package/eslint/NOTES.md
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html lang="en">
|
3
|
+
<head>
|
4
|
+
<meta charset="UTF-8" />
|
5
|
+
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
6
|
+
<title>mock api</title>
|
7
|
+
</head>
|
8
|
+
<body>
|
9
|
+
<h1>We are going to see how to use mock api</h1>
|
10
|
+
<ul>
|
11
|
+
<li>
|
12
|
+
Step 1:-
|
13
|
+
you need to start the app with "react-cli"."app"."server"."hasMock" as "true" in package.json
|
14
|
+
<code>npm run start --app-port=9090</code>
|
15
|
+
</li>
|
16
|
+
</ul>
|
17
|
+
</body>
|
18
|
+
</html>
|
@@ -0,0 +1,5 @@
|
|
1
|
+
# We are going to see how to use `Mock api`
|
2
|
+
|
3
|
+
- Step 1:-
|
4
|
+
you need to start the app with **"react-cli"."app"."server"."hasMock"** as `true` and **"react-cli"."app"."server"."hasMock"** as `true` in package.json <code>npm run start --app-port=9090</code>
|
5
|
+
- Step 2:- you need to start the app with **"react-cli"."app"."server"."hasMock"** as `true` in package.json <code>npm run start --app-port=9090</code>
|
package/lib/common/index.js
CHANGED
@@ -3,12 +3,6 @@
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
4
4
|
value: true
|
5
5
|
});
|
6
|
-
Object.defineProperty(exports, "splitChunks", {
|
7
|
-
enumerable: true,
|
8
|
-
get: function () {
|
9
|
-
return _splitChunks.default;
|
10
|
-
}
|
11
|
-
});
|
12
6
|
Object.defineProperty(exports, "getEntries", {
|
13
7
|
enumerable: true,
|
14
8
|
get: function () {
|
@@ -21,6 +15,12 @@ Object.defineProperty(exports, "getPublicPathConfig", {
|
|
21
15
|
return _getPublicPathConfig.default;
|
22
16
|
}
|
23
17
|
});
|
18
|
+
Object.defineProperty(exports, "splitChunks", {
|
19
|
+
enumerable: true,
|
20
|
+
get: function () {
|
21
|
+
return _splitChunks.default;
|
22
|
+
}
|
23
|
+
});
|
24
24
|
Object.defineProperty(exports, "templateParameters", {
|
25
25
|
enumerable: true,
|
26
26
|
get: function () {
|
@@ -2,9 +2,17 @@
|
|
2
2
|
|
3
3
|
var _path = _interopRequireDefault(require("path"));
|
4
4
|
|
5
|
+
var _libAlias = require("./libAlias");
|
6
|
+
|
5
7
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
6
8
|
|
7
|
-
let appPath = process.cwd();
|
9
|
+
let appPath = process.cwd(); // '^@root(.*)$': '<rootDir>/src$1',
|
10
|
+
// '^@components(.*)$': '<rootDir>/src/components$1',
|
11
|
+
|
12
|
+
let moduleNameMapper = Object.keys(_libAlias.libAlias).reduce((previousValue, key) => {
|
13
|
+
previousValue[`^${key}(.*)$`] = `${_libAlias.libAlias[key]}$1`;
|
14
|
+
return previousValue;
|
15
|
+
}, {});
|
8
16
|
let commonConfig = {
|
9
17
|
coverageReporters: ['json', 'html', 'json-summary', 'text'],
|
10
18
|
collectCoverage: true,
|
@@ -14,10 +22,11 @@ let commonConfig = {
|
|
14
22
|
'^.+\\.css$': _path.default.resolve(__dirname, '..', 'jest', 'preProcessors', 'cssPreprocessor.js'),
|
15
23
|
'^(?!.*\\.(js|jsx|css|json)$)': _path.default.resolve(__dirname, '..', 'jest', 'preProcessors', 'otherFilesPreprocessor.js')
|
16
24
|
},
|
17
|
-
moduleNameMapper: {
|
25
|
+
moduleNameMapper: { ...moduleNameMapper,
|
18
26
|
'\\.(css|less)$': 'identity-obj-proxy'
|
19
27
|
},
|
20
|
-
transformIgnorePatterns: ['/node_modules
|
28
|
+
transformIgnorePatterns: ['/node_modules/(?!(@zohodesk)/)'],
|
29
|
+
// transformIgnorePatterns: ['/node_modules.*?.js$'],
|
21
30
|
moduleFileExtensions: ['js'],
|
22
31
|
setupFiles: [_path.default.resolve(appPath, '__testUtils__', 'globals.js'), _path.default.resolve(__dirname, '..', 'jest', 'setup.js')],
|
23
32
|
globals: {
|
@@ -0,0 +1,31 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.libAlias = void 0;
|
7
|
+
// the reason for alias at the time was code tree shaking
|
8
|
+
// tree shaking was most compactable with ES module system
|
9
|
+
// FIXME: But there is a posiblity when these package does not have lib,
|
10
|
+
// app will work because of alias, But may be jest won't work because of not alais
|
11
|
+
// So need to think about use alais in jest
|
12
|
+
const libAlias = {
|
13
|
+
'@zohodesk/components/lib': '@zohodesk/components/es',
|
14
|
+
// '@zohodesk/zc-custom/lib': '@zohodesk/zc-custom/es',
|
15
|
+
'@zohodesk/dot/lib': '@zohodesk/dot/es',
|
16
|
+
'@zohodesk/i18n/lib': '@zohodesk/i18n/es',
|
17
|
+
'@zohodesk/icons/lib': '@zohodesk/icons/es',
|
18
|
+
'@zohodesk/normalizer/lib': '@zohodesk/normalizer/es',
|
19
|
+
'@zohodesk/perf-components/lib': '@zohodesk/perf-components/es',
|
20
|
+
'@zohodesk/perf-middleware/lib': '@zohodesk/perf-middleware/es',
|
21
|
+
'@zohodesk/permissions/lib': '@zohodesk/permissions/es',
|
22
|
+
'@zohodesk/platform-middleware/lib': '@zohodesk/platform-middleware/es',
|
23
|
+
'@zohodesk/react-dnd/lib': '@zohodesk/react-dnd/es',
|
24
|
+
'@zohodesk/router-middleware/lib': '@zohodesk/router-middleware/es',
|
25
|
+
'@zohodesk/storage/lib': '@zohodesk/storage/es',
|
26
|
+
'@zohodesk/svg/lib': '@zohodesk/svg/es',
|
27
|
+
'@zohodesk/timetracker/lib': '@zohodesk/timetracker/es',
|
28
|
+
'@zohodesk/variables/lib': '@zohodesk/variables/es',
|
29
|
+
'@zohodesk/virtualizer/lib': '@zohodesk/virtualizer/es'
|
30
|
+
};
|
31
|
+
exports.libAlias = libAlias;
|
@@ -10,6 +10,8 @@ var _pluginUtils = require("../pluginUtils");
|
|
10
10
|
|
11
11
|
var _loaderUtils = require("../loaderUtils");
|
12
12
|
|
13
|
+
var _libAlias = require("./libAlias");
|
14
|
+
|
13
15
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
14
16
|
|
15
17
|
let options = (0, _utils.getOptions)();
|
@@ -55,6 +57,9 @@ module.exports = {
|
|
55
57
|
entry: (0, _common.getEntries)(options, 'dev'),
|
56
58
|
devtool: sourcemap,
|
57
59
|
mode: 'development',
|
60
|
+
watchOptions: {
|
61
|
+
ignored: /node_modules.(?!@zohodesk)/
|
62
|
+
},
|
58
63
|
output,
|
59
64
|
stats: options.app.disableWatch ? 'errors-only' : {
|
60
65
|
children: false
|
@@ -127,25 +132,7 @@ module.exports = {
|
|
127
132
|
},
|
128
133
|
resolve: {
|
129
134
|
modules: [_path.default.resolve(__dirname, '..', '..', 'node_modules'), 'node_modules'],
|
130
|
-
alias: disableES5Transpile ? {
|
131
|
-
'@zohodesk/components/lib': '@zohodesk/components/es',
|
132
|
-
// "@zohodesk/zc-custom/lib": "@zohodesk/zc-custom/es",
|
133
|
-
'@zohodesk/dot/lib': '@zohodesk/dot/es',
|
134
|
-
'@zohodesk/i18n/lib': '@zohodesk/i18n/es',
|
135
|
-
'@zohodesk/icons/lib': '@zohodesk/icons/es',
|
136
|
-
'@zohodesk/normalizer/lib': '@zohodesk/normalizer/es',
|
137
|
-
'@zohodesk/perf-components/lib': '@zohodesk/perf-components/es',
|
138
|
-
'@zohodesk/perf-middleware/lib': '@zohodesk/perf-middleware/es',
|
139
|
-
'@zohodesk/permissions/lib': '@zohodesk/permissions/es',
|
140
|
-
'@zohodesk/platform-middleware/lib': '@zohodesk/platform-middleware/es',
|
141
|
-
'@zohodesk/react-dnd/lib': '@zohodesk/react-dnd/es',
|
142
|
-
'@zohodesk/router-middleware/lib': '@zohodesk/router-middleware/es',
|
143
|
-
'@zohodesk/storage/lib': '@zohodesk/storage/es',
|
144
|
-
'@zohodesk/svg/lib': '@zohodesk/svg/es',
|
145
|
-
'@zohodesk/timetracker/lib': '@zohodesk/timetracker/es',
|
146
|
-
'@zohodesk/variables/lib': '@zohodesk/variables/es',
|
147
|
-
'@zohodesk/virtualizer/lib': '@zohodesk/virtualizer/es'
|
148
|
-
} : {}
|
135
|
+
alias: disableES5Transpile ? _libAlias.libAlias : {}
|
149
136
|
},
|
150
137
|
resolveLoader: {
|
151
138
|
modules: [_path.default.resolve(__dirname, '..', '..', 'node_modules'), 'node_modules']
|
@@ -10,6 +10,10 @@ var _pluginUtils = require("../pluginUtils");
|
|
10
10
|
|
11
11
|
var _loaderUtils = require("../loaderUtils");
|
12
12
|
|
13
|
+
var _libAlias = require("./libAlias");
|
14
|
+
|
15
|
+
var _terserWebpackPlugin = _interopRequireDefault(require("terser-webpack-plugin"));
|
16
|
+
|
13
17
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
14
18
|
|
15
19
|
let options = (0, _utils.getOptions)();
|
@@ -64,6 +68,10 @@ if (isDevelopment) {
|
|
64
68
|
}
|
65
69
|
|
66
70
|
let shouldRemovePropTypes = !isDevelopment && removePropTypes;
|
71
|
+
const useEsbulid = false; // const SpeedMeasurePlugin = require("speed-measure-webpack-plugin");
|
72
|
+
// const smp = new SpeedMeasurePlugin();
|
73
|
+
// module.exports = smp.wrap({
|
74
|
+
|
67
75
|
module.exports = {
|
68
76
|
entry: (0, _common.getEntries)(options, 'production'),
|
69
77
|
devtool: isDevelopment ? 'cheap-module-source-map' : enableSMap ? 'hidden-source-map' : 'none',
|
@@ -76,12 +84,20 @@ module.exports = {
|
|
76
84
|
},
|
77
85
|
concatenateModules: true,
|
78
86
|
minimize: true,
|
87
|
+
// by default if minimize: true in webpack minimize then webpack automaticaly add TerserPlugin,
|
88
|
+
// So we are overrideing it.
|
89
|
+
minimizer: [new _terserWebpackPlugin.default({
|
90
|
+
cache: true,
|
91
|
+
parallel: true,
|
92
|
+
sourceMap: isDevelopment && enableSMap,
|
93
|
+
exclude: /\/smap/
|
94
|
+
})],
|
79
95
|
moduleIds: 'named'
|
80
96
|
},
|
81
97
|
stats: {
|
82
98
|
children: false,
|
83
99
|
colors: true,
|
84
|
-
|
100
|
+
excludeAssets: /./,
|
85
101
|
warningsFilter: /\[mini-css-extract-plugin\]/
|
86
102
|
},
|
87
103
|
plugins: (0, _pluginUtils.getProdPlugins)(options, output.publicPath),
|
@@ -90,7 +106,15 @@ module.exports = {
|
|
90
106
|
strictExportPresence: true,
|
91
107
|
rules: [{
|
92
108
|
test: /\.js$/,
|
93
|
-
use: [{
|
109
|
+
use: [useEsbulid && {
|
110
|
+
loader: 'esbuild-loader',
|
111
|
+
options: {
|
112
|
+
loader: 'jsx',
|
113
|
+
// Remove this if you're not using JSX
|
114
|
+
target: 'es2015' // Syntax to compile to (see options below for possible values)
|
115
|
+
|
116
|
+
}
|
117
|
+
}, !useEsbulid && {
|
94
118
|
loader: 'babel-loader',
|
95
119
|
options: {
|
96
120
|
presets: [[require.resolve('@babel/preset-env'), disableES5Transpile ? {
|
@@ -113,7 +137,8 @@ module.exports = {
|
|
113
137
|
}] : null].filter(Boolean),
|
114
138
|
cacheDirectory: true
|
115
139
|
}
|
116
|
-
}],
|
140
|
+
}].filter(Boolean),
|
141
|
+
// include: path.join(appPath, folder)
|
117
142
|
include: module => {
|
118
143
|
let srcPath = _path.default.join(appPath, folder);
|
119
144
|
|
@@ -130,7 +155,7 @@ module.exports = {
|
|
130
155
|
exclude: /\.module\.css$/,
|
131
156
|
use: (0, _loaderUtils.getCSSLoaders)(hasRTL, rtlExclude, '[local]', false, null)
|
132
157
|
} : null, {
|
133
|
-
test: seperateCssModules ? /\.module\.css$/ :
|
158
|
+
test: seperateCssModules ? /\.module\.css$/ : /\.css$/,
|
134
159
|
use: (0, _loaderUtils.getCSSLoaders)(hasRTL, rtlExclude, false, cssUniqueness, selectorReplace, cssHashSelectors, classNamePrefix)
|
135
160
|
}, {
|
136
161
|
test: /\.jpe?g$|\.gif$|\.png$/,
|
@@ -194,25 +219,7 @@ module.exports = {
|
|
194
219
|
},
|
195
220
|
resolve: {
|
196
221
|
modules: [_path.default.resolve(__dirname, '..', '..', 'node_modules'), 'node_modules'],
|
197
|
-
alias: disableES5Transpile ? {
|
198
|
-
'@zohodesk/components/lib': '@zohodesk/components/es',
|
199
|
-
// '@zohodesk/zc-custom/lib': '@zohodesk/zc-custom/es',
|
200
|
-
'@zohodesk/dot/lib': '@zohodesk/dot/es',
|
201
|
-
'@zohodesk/i18n/lib': '@zohodesk/i18n/es',
|
202
|
-
'@zohodesk/icons/lib': '@zohodesk/icons/es',
|
203
|
-
'@zohodesk/normalizer/lib': '@zohodesk/normalizer/es',
|
204
|
-
'@zohodesk/perf-components/lib': '@zohodesk/perf-components/es',
|
205
|
-
'@zohodesk/perf-middleware/lib': '@zohodesk/perf-middleware/es',
|
206
|
-
'@zohodesk/permissions/lib': '@zohodesk/permissions/es',
|
207
|
-
'@zohodesk/platform-middleware/lib': '@zohodesk/platform-middleware/es',
|
208
|
-
'@zohodesk/react-dnd/lib': '@zohodesk/react-dnd/es',
|
209
|
-
'@zohodesk/router-middleware/lib': '@zohodesk/router-middleware/es',
|
210
|
-
'@zohodesk/storage/lib': '@zohodesk/storage/es',
|
211
|
-
'@zohodesk/svg/lib': '@zohodesk/svg/es',
|
212
|
-
'@zohodesk/timetracker/lib': '@zohodesk/timetracker/es',
|
213
|
-
'@zohodesk/variables/lib': '@zohodesk/variables/es',
|
214
|
-
'@zohodesk/virtualizer/lib': '@zohodesk/virtualizer/es'
|
215
|
-
} : {}
|
222
|
+
alias: disableES5Transpile ? _libAlias.libAlias : {}
|
216
223
|
},
|
217
224
|
resolveLoader: {
|
218
225
|
modules: [_path.default.resolve(__dirname, '..', '..', 'node_modules'), 'node_modules']
|
package/lib/loaderUtils/index.js
CHANGED
@@ -3,16 +3,16 @@
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
4
4
|
value: true
|
5
5
|
});
|
6
|
-
Object.defineProperty(exports, "
|
6
|
+
Object.defineProperty(exports, "getCSSLoaders", {
|
7
7
|
enumerable: true,
|
8
8
|
get: function () {
|
9
|
-
return
|
9
|
+
return _getCSSLoaders.default;
|
10
10
|
}
|
11
11
|
});
|
12
|
-
Object.defineProperty(exports, "
|
12
|
+
Object.defineProperty(exports, "getDevJsLoaders", {
|
13
13
|
enumerable: true,
|
14
14
|
get: function () {
|
15
|
-
return
|
15
|
+
return _getDevJsLoaders.default;
|
16
16
|
}
|
17
17
|
});
|
18
18
|
|
@@ -55,6 +55,7 @@ let getDevPlugins = (options, publicPath) => {
|
|
55
55
|
},
|
56
56
|
efc: {
|
57
57
|
hasEFC: newOptionForEnableEFC,
|
58
|
+
templateFilePath,
|
58
59
|
nameScope: efcNameSpace,
|
59
60
|
localeAttr: efcLocaleAttr
|
60
61
|
},
|
@@ -162,6 +163,7 @@ let getDevPlugins = (options, publicPath) => {
|
|
162
163
|
plugins.push(new _plugins.EFCPlugin({
|
163
164
|
isDevelopment: true,
|
164
165
|
i18nManifestFileName,
|
166
|
+
templateFilePath,
|
165
167
|
i18nFileNameTemplate,
|
166
168
|
serverUrl: publicPath,
|
167
169
|
entryPointName: 'efc',
|
@@ -35,7 +35,10 @@ var _RtlCssPlugin = require("../plugins/RtlSplitPlugin/RtlCssPlugin");
|
|
35
35
|
|
36
36
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
37
37
|
|
38
|
+
// import { ESBuildMinifyPlugin } from 'esbuild-loader';
|
39
|
+
const useEsbulid = false; // console.log('build is runnnig');
|
38
40
|
// eslint-disable-next-line no-unused-vars
|
41
|
+
|
39
42
|
let getProdPlugins = (options, publicPath = '') => {
|
40
43
|
let {
|
41
44
|
enableChunkHash,
|
@@ -72,6 +75,7 @@ let getProdPlugins = (options, publicPath = '') => {
|
|
72
75
|
const {
|
73
76
|
hasEFC: newOptionForEnableEFC,
|
74
77
|
nameScope: efcNameSpace,
|
78
|
+
templateFilePath,
|
75
79
|
localeAttr: efcLocaleAttr
|
76
80
|
} = options.efc;
|
77
81
|
const hasEFC = newOptionForEnableEFC || prevOptionForEnableEFC;
|
@@ -93,7 +97,7 @@ let getProdPlugins = (options, publicPath = '') => {
|
|
93
97
|
// ignoreOrder: true,
|
94
98
|
filename: cssLTRFileNameTempalte,
|
95
99
|
chunkFilename: cssLTRFileNameTempalte
|
96
|
-
}), new _plugins.ResourceHintsPlugin(), new _plugins.UglifyCSSPlugin()];
|
100
|
+
}), new _plugins.ResourceHintsPlugin(), !useEsbulid && new _plugins.UglifyCSSPlugin()].filter(Boolean);
|
97
101
|
|
98
102
|
if (enableRTLSplit) {
|
99
103
|
plugins.push(new _RtlCssPlugin.RtlCssPlugin({
|
@@ -166,6 +170,7 @@ let getProdPlugins = (options, publicPath = '') => {
|
|
166
170
|
isDevelopment,
|
167
171
|
serverUrl: publicPath,
|
168
172
|
i18nFileNameTemplate,
|
173
|
+
templateFilePath,
|
169
174
|
i18nManifestFileName,
|
170
175
|
entryPointName: 'efc',
|
171
176
|
// outputFile: 'zohodesk-efc-sdk-latest.js',
|
@@ -221,8 +226,11 @@ let getProdPlugins = (options, publicPath = '') => {
|
|
221
226
|
hasShadowDOM && plugins.push(new _plugins.ShadowDOMSupportPlugin());
|
222
227
|
|
223
228
|
if (!isDevelopment) {
|
224
|
-
enableSMap && enableSMapHook && plugins.push(new _plugins.SourceMapHookPlugin());
|
225
|
-
optimize &&
|
229
|
+
enableSMap && enableSMapHook && plugins.push(new _plugins.SourceMapHookPlugin()); // optimize && plugins.push(new OptimizeJSPlugin());
|
230
|
+
// optimize &&
|
231
|
+
// plugins.push(
|
232
|
+
// );
|
233
|
+
|
226
234
|
plugins.push(new _plugins.ManifestPlugin({
|
227
235
|
fileName: manifestFileName
|
228
236
|
}));
|
package/lib/pluginUtils/index.js
CHANGED
@@ -9,34 +9,28 @@ Object.defineProperty(exports, "getDevPlugins", {
|
|
9
9
|
return _getDevPlugins.default;
|
10
10
|
}
|
11
11
|
});
|
12
|
-
Object.defineProperty(exports, "getProdPlugins", {
|
13
|
-
enumerable: true,
|
14
|
-
get: function () {
|
15
|
-
return _getProdPlugins.default;
|
16
|
-
}
|
17
|
-
});
|
18
12
|
Object.defineProperty(exports, "getDocsPlugins", {
|
19
13
|
enumerable: true,
|
20
14
|
get: function () {
|
21
15
|
return _getDocsPlugins.default;
|
22
16
|
}
|
23
17
|
});
|
24
|
-
Object.defineProperty(exports, "
|
18
|
+
Object.defineProperty(exports, "getLibraryPlugins", {
|
25
19
|
enumerable: true,
|
26
20
|
get: function () {
|
27
|
-
return
|
21
|
+
return _getLibraryPlugins.default;
|
28
22
|
}
|
29
23
|
});
|
30
|
-
Object.defineProperty(exports, "
|
24
|
+
Object.defineProperty(exports, "getProdPlugins", {
|
31
25
|
enumerable: true,
|
32
26
|
get: function () {
|
33
|
-
return
|
27
|
+
return _getProdPlugins.default;
|
34
28
|
}
|
35
29
|
});
|
36
|
-
Object.defineProperty(exports, "
|
30
|
+
Object.defineProperty(exports, "getServerPlugins", {
|
37
31
|
enumerable: true,
|
38
32
|
get: function () {
|
39
|
-
return
|
33
|
+
return _getServerPlugins.default;
|
40
34
|
}
|
41
35
|
});
|
42
36
|
Object.defineProperty(exports, "getUMDCSSPlugins", {
|
@@ -45,6 +39,12 @@ Object.defineProperty(exports, "getUMDCSSPlugins", {
|
|
45
39
|
return _getUMDCSSPlugins.default;
|
46
40
|
}
|
47
41
|
});
|
42
|
+
Object.defineProperty(exports, "getUMDComponentPlugins", {
|
43
|
+
enumerable: true,
|
44
|
+
get: function () {
|
45
|
+
return _getUMDComponentPlugins.default;
|
46
|
+
}
|
47
|
+
});
|
48
48
|
|
49
49
|
var _getDevPlugins = _interopRequireDefault(require("./getDevPlugins"));
|
50
50
|
|