@zohodesk/react-cli 0.0.1-beta.166 → 0.0.1-beta.169
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/.prettierrc +6 -0
- package/README.md +83 -3
- package/bin/cli.js +10 -15
- package/cert/Tsicsezwild-22-23.crt +37 -0
- package/cert/Tsicsezwild-22-23.key +27 -0
- package/docs/DevStart.md +18 -0
- package/docs/HoverActive.md +12 -0
- package/docs/InstallNode.md +28 -0
- package/lib/configs/jest.config.js +6 -1
- package/lib/configs/webpack.dev.config.js +13 -17
- package/lib/configs/webpack.docs.config.js +35 -36
- package/lib/configs/webpack.impact.config.js +8 -14
- package/lib/configs/webpack.prod.config.js +8 -5
- package/lib/loaderUtils/configsAssetsLoaders.js +88 -0
- package/lib/loaderUtils/getCSSLoaders.js +5 -3
- package/lib/plugins/I18nSplitPlugin/I18nSplit.md +63 -54
- package/lib/postcss-plugins/__test__/hoverActivePlugin.spec.js +22 -0
- package/lib/postcss-plugins/__test__/test1Input.css +39 -0
- package/lib/postcss-plugins/__test__/test1Output.css +39 -0
- package/lib/postcss-plugins/hoverActivePlugin.js +365 -0
- package/lib/schemas/index.js +31 -4
- package/lib/servers/{devBulid.js → devBuild.js} +7 -3
- package/lib/servers/getCliPath.js +7 -3
- package/lib/servers/httpsOptions.js +2 -3
- package/lib/servers/nowatchserver.js +2 -2
- package/lib/servers/server.js +11 -3
- package/lib/utils/repoClone.js +5 -2
- package/lib/utils/rtl.js +19 -2
- package/lib/utils/useExitCleanup.js +55 -0
- package/package.json +5 -1
- package/postpublish.js +6 -0
- package/cert/cert.pem +0 -37
- package/cert/key.pem +0 -27
- package/cert/passphrase.pem +0 -1
package/.prettierrc
ADDED
package/README.md
CHANGED
@@ -2,6 +2,86 @@
|
|
2
2
|
|
3
3
|
A CLI tool for build modern web application and libraries
|
4
4
|
|
5
|
+
# 0.0.1-beta.169
|
6
|
+
|
7
|
+
this version has same as `0.0.1-exp.168.1`, `0.0.1-exp.168.2`, `0.0.1-exp.168.3` and below and some minor changes
|
8
|
+
|
9
|
+
1. `--efc_version=v3` flag added for change efc version via commmand line option
|
10
|
+
2. `hoverActive` flag added for conversion from usual hover to @media(hover:hover) and @media(hover:none) queries for hover support in mobile.
|
11
|
+
3. `combinerMq` flag added for combination of the media queries that might be appended or existing media queries that are duplicates to create one media query with all rules put together.
|
12
|
+
|
13
|
+
# 0.0.1-exp.168.3
|
14
|
+
|
15
|
+
Changes :
|
16
|
+
|
17
|
+
1. code optimization ( made functions for the hoverActive cases making it more easier to access)
|
18
|
+
2. handled `hover:ignore`, `active:ignore`, `hoverActive:ignore` cases for usual queries and media queries
|
19
|
+
|
20
|
+
# 0.0.1-exp.168.2
|
21
|
+
|
22
|
+
Changes :
|
23
|
+
|
24
|
+
1. hoverActive case handled with postcss `hover:hover` media query and `hover:none` media query is added
|
25
|
+
2. flag for hoverActive used to add/remove postcss changes
|
26
|
+
|
27
|
+
# 0.0.1-exp.168.1
|
28
|
+
|
29
|
+
Changes:-
|
30
|
+
|
31
|
+
1. `cliRootPath` option removed `react-cli.app.cliRootPath` in `package.json`
|
32
|
+
Due to the reason we updated our logic to find package's executable path.
|
33
|
+
2. `--efc_output_file=efc-sdk-[version].js` option added to modify efc output file by terminal
|
34
|
+
3. added logic to print error message during command run, Previously when executable not found error messages not printed
|
35
|
+
|
36
|
+
# 0.0.1-beta.168
|
37
|
+
|
38
|
+
Changes:-
|
39
|
+
|
40
|
+
1. `enableChunkHash` option enabled for dev mode, use it as `react-cli.app.enableChunkHash` in `package.json`
|
41
|
+
2. `--enable_efc=true` option added to enable efc by terminal
|
42
|
+
3. unwanted pem files removed
|
43
|
+
|
44
|
+
# 0.0.1-beta.167
|
45
|
+
|
46
|
+
SSL certificate update
|
47
|
+
this version has same as `0.0.1-exp.166.1`, `0.0.1-exp.166.2` and below and some minor changes
|
48
|
+
Features:-
|
49
|
+
|
50
|
+
- `--shallow_clone` option to `react-cli clone` this option will be usefull for shallow cloning repos in build time we don't need commit messages it will be 2x fast this way
|
51
|
+
- Example `react-cli clone --clone_type=git --clone_url=https://some.url --shallow_clone`
|
52
|
+
- `cliRootPath` option added for npm workspace related path problems
|
53
|
+
- Usage `package.json` , "react-cli" => "cliRootPath" stright key
|
54
|
+
- `unstableDepsInverse` option added for use app need library first priority over react-cli packages
|
55
|
+
- Usage `package.json` , "react-cli" => "unstableDepsInverse" stright key
|
56
|
+
|
57
|
+
Issue Fix :-
|
58
|
+
|
59
|
+
- In devmode initial html not recived after second rebuild issue fix.
|
60
|
+
- typo fix `devBulid` to `devBuild`.
|
61
|
+
- `disableES5Transpile` option missed in docs now added.
|
62
|
+
- docs libAlias not work as app for example in app we always take `es` folder to build for treshaking and reasons,
|
63
|
+
But that option not enabled in docs. now it is enabled.
|
64
|
+
- In `react-cli devbuild` command options not working properly,
|
65
|
+
when above command run via terminal not via npm run script options not working
|
66
|
+
So we send that options to webpack then it works as expected.
|
67
|
+
this behaviour need to check across os and need to be cross check with other commends as well for now we only fixed this
|
68
|
+
|
69
|
+
# 0.0.1-exp.166.2
|
70
|
+
|
71
|
+
Changes:-
|
72
|
+
|
73
|
+
- `-w` option (watch option) added for `react-cli rtl`
|
74
|
+
- Example `react-cli rtl ./src ./lib -w`
|
75
|
+
<!-- need to handle `react-cli rtl` options correctly -->
|
76
|
+
- disableES5Transpile option libAlias added for docs
|
77
|
+
|
78
|
+
# 0.0.1-exp.166.1
|
79
|
+
|
80
|
+
Changes:-
|
81
|
+
|
82
|
+
- `__testUtils__/globals.js` to jest is not mantatory
|
83
|
+
- disableES5Transpile option libAlias added
|
84
|
+
|
5
85
|
# 0.0.1-beta.166
|
6
86
|
|
7
87
|
this version has same as `# 0.0.1-exp.164.1`, `# 0.0.1-exp.164.2` and below and some minor changes
|
@@ -10,7 +90,7 @@ this version has same as `# 0.0.1-exp.164.1`, `# 0.0.1-exp.164.2` and below and
|
|
10
90
|
|
11
91
|
# 0.0.1-beta.165
|
12
92
|
|
13
|
-
- `valueReplacer` option added in shemas for font name replace related issue handling, for more [details](
|
93
|
+
- `valueReplacer` option added in shemas for font name replace related issue handling, for more [details](https://zgit.csez.zohocorpin.com/zohodesk/react-cli/-/blob/2.0.0/docs/ValueReplacer.md)
|
14
94
|
- `valuereplacer` option added in react-cli it takes three
|
15
95
|
1. sourceDir
|
16
96
|
2. distDir
|
@@ -18,7 +98,7 @@ this version has same as `# 0.0.1-exp.164.1`, `# 0.0.1-exp.164.2` and below and
|
|
18
98
|
|
19
99
|
# 0.0.1-exp.164.1
|
20
100
|
|
21
|
-
- extra features in custom chunks reffer [this](
|
101
|
+
- extra features in custom chunks reffer [this](https://zgit.csez.zohocorpin.com/zohodesk/react-cli/-/blob/2.0.0/docs/CustomChunks.md)
|
22
102
|
|
23
103
|
# 0.0.1-exp.164.2
|
24
104
|
|
@@ -108,7 +188,7 @@ this version has same as `# 0.0.1-exp.164.1`, `# 0.0.1-exp.164.2` and below and
|
|
108
188
|
|
109
189
|
# 0.0.1-exp.159
|
110
190
|
|
111
|
-
-
|
191
|
+
- issue fix:-
|
112
192
|
- when rtl ltr css split enable manifest json css filename keys comes with hash .
|
113
193
|
|
114
194
|
# 0.0.1-beta.158
|
package/bin/cli.js
CHANGED
@@ -1,16 +1,24 @@
|
|
1
1
|
#!/usr/bin/env node
|
2
2
|
|
3
3
|
const path = require('path');
|
4
|
-
const os = require('os');
|
5
4
|
const { existsSync } = require('fs');
|
6
|
-
const { spawnSync, spawn } = require('child_process');
|
5
|
+
const { spawnSync: _spawnSync, spawn } = require('child_process');
|
7
6
|
const { getOptions } = require('../lib/utils/index.js');
|
8
7
|
|
9
8
|
const { log } = require('../lib/utils');
|
9
|
+
const { getCliPath } = require('../lib/servers/getCliPath.js');
|
10
10
|
//initPreCommitHook();
|
11
11
|
|
12
12
|
const options = getOptions();
|
13
13
|
|
14
|
+
function spawnSync(...args) {
|
15
|
+
const result = _spawnSync(...args);
|
16
|
+
if (result.error) {
|
17
|
+
console.error(result.error);
|
18
|
+
}
|
19
|
+
return result;
|
20
|
+
}
|
21
|
+
|
14
22
|
const { esLint: esLintOptions } = options || {};
|
15
23
|
const { preprocess } = options;
|
16
24
|
const {
|
@@ -20,23 +28,10 @@ const {
|
|
20
28
|
reportPath: reportPath
|
21
29
|
} = esLintOptions || {};
|
22
30
|
|
23
|
-
const isWindows = os.platform().toLowerCase() === 'win32';
|
24
|
-
|
25
31
|
const [, , option] = process.argv;
|
26
32
|
const args = process.argv.slice(3);
|
27
33
|
const appPath = process.cwd();
|
28
34
|
|
29
|
-
const isNodeModuleUnderAppFolder = __dirname.indexOf(appPath) !== -1;
|
30
|
-
|
31
|
-
const _getCliPath = !isNodeModuleUnderAppFolder
|
32
|
-
? libName => path.join(__dirname, '..', 'node_modules', '.bin', libName)
|
33
|
-
: libName => libName;
|
34
|
-
const suffixExt = isWindows ? '.cmd' : '';
|
35
|
-
|
36
|
-
function getCliPath(libName) {
|
37
|
-
return _getCliPath(libName) + suffixExt;
|
38
|
-
}
|
39
|
-
|
40
35
|
const webpack = getCliPath('webpack');
|
41
36
|
|
42
37
|
const nodemon = getCliPath('nodemon');
|
@@ -0,0 +1,37 @@
|
|
1
|
+
-----BEGIN CERTIFICATE-----
|
2
|
+
MIIGXjCCBUagAwIBAgIRAMKJgToWlDYncIf54wIl/K4wDQYJKoZIhvcNAQELBQAw
|
3
|
+
gY8xCzAJBgNVBAYTAkdCMRswGQYDVQQIExJHcmVhdGVyIE1hbmNoZXN0ZXIxEDAO
|
4
|
+
BgNVBAcTB1NhbGZvcmQxGDAWBgNVBAoTD1NlY3RpZ28gTGltaXRlZDE3MDUGA1UE
|
5
|
+
AxMuU2VjdGlnbyBSU0EgRG9tYWluIFZhbGlkYXRpb24gU2VjdXJlIFNlcnZlciBD
|
6
|
+
QTAeFw0yMjA0MjAwMDAwMDBaFw0yMzA0MjAyMzU5NTlaMB4xHDAaBgNVBAMTE2Nz
|
7
|
+
ZXouem9ob2NvcnBpbi5jb20wggEiMA0GCSqGSI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B86HVdaadq2VmuOdyGa+tLkPh8v47vPGB/vpRlThuuRRc51Oq+SRh7bC7
|
17
|
+
FO4cjOa6VpM9dkeAc2GFPs+uyzzU8yRxeqO3gicvXC1sApaca9uv8Vp3WDacnlsu
|
18
|
+
shVM+RXKLEi8/JHrcr9BCvSlycvZy8t+QUp6LicCgYBE1ocBJ1bTQEESlHfbj2OL
|
19
|
+
eYEBzXCkW4Il5fbmoT3keMr/gzOLgPGDGYY3cuD0IBQzPor5jsd5wnTMVHujwlNS
|
20
|
+
TtOtN0kCY6m+tLeiRMLyeO/8rq5/BrOrB17qQS0XhggVAq5FIMNKtYof3bEUCMSz
|
21
|
+
fVR6Zk9APZvMt9CXiSuz4QKBgFHDMMrCpUd2KLrOKaubbrjJSUv2Hrv0GyJKXrPc
|
22
|
+
m20Il8uA5s1trAWDwQIOmqn58iBayQeqYIOAVETLgwrcp49d6OUjRgmGsheLIjkD
|
23
|
+
/wVLuBfeAwQ+TeGKNN21kNlzqj6R/sOktk/Q+7x9ETb6/cDgnpOa3fZMY5mxFt44
|
24
|
+
fZ7pAoGBAN8ep49qQWxChYfqu75d3dkCcbF6UeWS+mDZ1QDkiJ5hGlDWDAC7EUma
|
25
|
+
jf7c56wBydih+2XKFq2BWxyFcfzzxKJrNeMhGANi/yJ1QrECyrwVWnhP+OFfG5vR
|
26
|
+
O+PzUCwZGet0PHG6r6IuvpGMCdZDYCt+fZSvIRJtmvIrtZWGKQly
|
27
|
+
-----END RSA PRIVATE KEY-----
|
package/docs/DevStart.md
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
# DevServer Start
|
2
|
+
|
3
|
+
## command
|
4
|
+
|
5
|
+
> `react-cli start`
|
6
|
+
|
7
|
+
## Options
|
8
|
+
|
9
|
+
we have to typs of options command line arguments and package.json option specifying
|
10
|
+
|
11
|
+
### First package.json option specifying
|
12
|
+
|
13
|
+
1. `react-cli.app.context`
|
14
|
+
1. `react-cli.app.server`
|
15
|
+
1. `react-cli.app.server`
|
16
|
+
1. `react-cli.app.server`
|
17
|
+
1. `react-cli.app.server`
|
18
|
+
1. `react-cli.app.server`
|
@@ -0,0 +1,12 @@
|
|
1
|
+
# hover active css handling
|
2
|
+
|
3
|
+
In general we write css with some hover in it.
|
4
|
+
But In mobile there is no hover and some times this hover css may do something messy some thing like we may need to click a button we need to click it double time.
|
5
|
+
|
6
|
+
To handle this behaviour we write a postcss plugin
|
7
|
+
|
8
|
+
PostCSS plugin that transforms :hover selectors to :active on devices where a mouse isn't the primary input mechanism.
|
9
|
+
|
10
|
+
when we write hover css it will have some problem in mobile devices the reason was in mobile device ther is no mouse
|
11
|
+
|
12
|
+
for this we have to handle that as
|
@@ -0,0 +1,28 @@
|
|
1
|
+
### Step 1: Update APT index
|
2
|
+
|
3
|
+
Run the apt update command on your Ubuntu Linux to update package repository contents database.
|
4
|
+
|
5
|
+
> sudo apt update
|
6
|
+
|
7
|
+
### Step 2: Install Node.js 14 on Ubuntu 22.04|20.04|18.04
|
8
|
+
|
9
|
+
After system update, install Node.js 14 on Ubuntu 22.04|20.04|18.04 by first installing the required repository.
|
10
|
+
|
11
|
+
> curl -sL https://deb.nodesource.com/setup_14.x | sudo bash -
|
12
|
+
|
13
|
+
The script above will create apt sources list file for the NodeSource Node.js 14.x repo:
|
14
|
+
|
15
|
+
> \# Ubuntu 20.04 example
|
16
|
+
>
|
17
|
+
> $ cat /etc/apt/sources.list.d/nodesource.list
|
18
|
+
> deb https://deb.nodesource.com/node_14.x focal main
|
19
|
+
> deb-src https://deb.nodesource.com/node_14.x focal main
|
20
|
+
|
21
|
+
Once the repository is added, you can begin the installation of Node.js 14 on Ubuntu Linux:
|
22
|
+
|
23
|
+
> sudo apt -y install nodejs
|
24
|
+
|
25
|
+
Verify the version of Node.js installed.
|
26
|
+
|
27
|
+
> $ node -v
|
28
|
+
> v14.17.5
|
@@ -1,5 +1,7 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
|
+
var _fs = require("fs");
|
4
|
+
|
3
5
|
var _path = _interopRequireDefault(require("path"));
|
4
6
|
|
5
7
|
var _libAlias = require("./libAlias");
|
@@ -13,6 +15,9 @@ let moduleNameMapper = Object.keys(_libAlias.libAlias).reduce((previousValue, ke
|
|
13
15
|
previousValue[`^${key}(.*)$`] = `${_libAlias.libAlias[key]}$1`;
|
14
16
|
return previousValue;
|
15
17
|
}, {});
|
18
|
+
|
19
|
+
const appGlobals = _path.default.resolve(appPath, '__testUtils__', 'globals.js');
|
20
|
+
|
16
21
|
let commonConfig = {
|
17
22
|
coverageReporters: ['json', 'html', 'json-summary', 'text'],
|
18
23
|
collectCoverage: true,
|
@@ -28,7 +33,7 @@ let commonConfig = {
|
|
28
33
|
transformIgnorePatterns: ['/node_modules/(?!(@zohodesk)/)'],
|
29
34
|
// transformIgnorePatterns: ['/node_modules.*?.js$'],
|
30
35
|
moduleFileExtensions: ['js'],
|
31
|
-
setupFiles: [
|
36
|
+
setupFiles: [(0, _fs.existsSync)(appGlobals) && appGlobals, _path.default.resolve(__dirname, '..', 'jest', 'setup.js')].filter(Boolean),
|
32
37
|
globals: {
|
33
38
|
__DEVELOPMENT__: true,
|
34
39
|
__DOCS__: false,
|
@@ -12,20 +12,27 @@ var _loaderUtils = require("../loaderUtils");
|
|
12
12
|
|
13
13
|
var _libAlias = require("./libAlias");
|
14
14
|
|
15
|
+
var _configsAssetsLoaders = require("../loaderUtils/configsAssetsLoaders");
|
16
|
+
|
15
17
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
16
18
|
|
17
19
|
let options = (0, _utils.getOptions)();
|
18
20
|
let {
|
21
|
+
unstableDepsInverse,
|
19
22
|
app: {
|
20
23
|
folder,
|
21
24
|
context,
|
22
25
|
server,
|
23
26
|
outputFolder,
|
24
27
|
rtlExclude,
|
28
|
+
combinerMq,
|
25
29
|
hasRTL,
|
30
|
+
hoverActive,
|
26
31
|
cssUniqueness,
|
27
32
|
seperateCssModules,
|
28
33
|
changeRuntimeChunkChar,
|
34
|
+
// we are going to use this for fonts file name collide in issue in devmode
|
35
|
+
enableChunkHash,
|
29
36
|
cssHashSelectors,
|
30
37
|
classNamePrefix,
|
31
38
|
selectorReplace,
|
@@ -48,6 +55,7 @@ let output = {
|
|
48
55
|
publicPath: `${[serverUrl, contextURL].filter(a => a).join('/')}/`,
|
49
56
|
jsonpFunction: `${context}Jsonp`
|
50
57
|
};
|
58
|
+
const nameTemplate = (0, _configsAssetsLoaders.createNameTemplate)(enableChunkHash);
|
51
59
|
|
52
60
|
if (crossorigin) {
|
53
61
|
output.crossOriginLoading = 'anonymous';
|
@@ -92,23 +100,11 @@ module.exports = {
|
|
92
100
|
}, seperateCssModules ? {
|
93
101
|
test: /\.css$/,
|
94
102
|
exclude: /\.module\.css$/,
|
95
|
-
use: (0, _loaderUtils.getCSSLoaders)(hasRTL, rtlExclude, '[local]', false, null)
|
103
|
+
use: (0, _loaderUtils.getCSSLoaders)(hasRTL, rtlExclude, combinerMq, hoverActive, '[local]', false, null)
|
96
104
|
} : null, {
|
97
105
|
test: seperateCssModules ? /\.module\.css$/ : /(\.module)?\.css$/,
|
98
|
-
use: (0, _loaderUtils.getCSSLoaders)(hasRTL, rtlExclude, null, cssUniqueness, selectorReplace, cssHashSelectors, classNamePrefix)
|
99
|
-
}, {
|
100
|
-
test: /\.jpe?g$|\.gif$|\.png$/,
|
101
|
-
use: ['url-loader?limit=1000&name=./images/[name].[ext]']
|
102
|
-
}, {
|
103
|
-
test: /\.woff2|\.woff$|\.ttf$|\.eot$/,
|
104
|
-
use: ['url-loader?limit=1000&name=./fonts/[name].[ext]']
|
105
|
-
}, {
|
106
|
-
test: /\.svg$/,
|
107
|
-
use: ['url-loader?limit=1&name=./fonts/[name].[ext]']
|
108
|
-
}, {
|
109
|
-
test: /\.ogg$/,
|
110
|
-
use: ['file-loader?name=./fonts/[name].[ext]']
|
111
|
-
}, {
|
106
|
+
use: (0, _loaderUtils.getCSSLoaders)(hasRTL, combinerMq, rtlExclude, hoverActive, null, cssUniqueness, selectorReplace, cssHashSelectors, classNamePrefix)
|
107
|
+
}, (0, _configsAssetsLoaders.configImageLoader)(nameTemplate), (0, _configsAssetsLoaders.configFontLoader)(nameTemplate), (0, _configsAssetsLoaders.configSVGLoader)(nameTemplate), (0, _configsAssetsLoaders.configAudioLoader)(nameTemplate), {
|
112
108
|
test: /\.tmpl$/,
|
113
109
|
use: [{
|
114
110
|
loader: 'html-loader',
|
@@ -131,10 +127,10 @@ module.exports = {
|
|
131
127
|
ZC: '$ZC'
|
132
128
|
},
|
133
129
|
resolve: {
|
134
|
-
modules: [_path.default.resolve(__dirname, '..', '..', 'node_modules'), 'node_modules'],
|
130
|
+
modules: unstableDepsInverse ? ['node_modules', _path.default.resolve(__dirname, '..', '..', 'node_modules')] : [_path.default.resolve(__dirname, '..', '..', 'node_modules'), 'node_modules'],
|
135
131
|
alias: disableES5Transpile ? _libAlias.libAlias : {}
|
136
132
|
},
|
137
133
|
resolveLoader: {
|
138
|
-
modules: [_path.default.resolve(__dirname, '..', '..', 'node_modules'), 'node_modules']
|
134
|
+
modules: unstableDepsInverse ? ['node_modules', _path.default.resolve(__dirname, '..', '..', 'node_modules')] : [_path.default.resolve(__dirname, '..', '..', 'node_modules'), 'node_modules']
|
139
135
|
}
|
140
136
|
};
|
@@ -8,14 +8,23 @@ var _pluginUtils = require("../pluginUtils");
|
|
8
8
|
|
9
9
|
var _loaderUtils = require("../loaderUtils");
|
10
10
|
|
11
|
+
var _libAlias = require("./libAlias");
|
12
|
+
|
13
|
+
var _configsAssetsLoaders = require("../loaderUtils/configsAssetsLoaders");
|
14
|
+
|
11
15
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
12
16
|
|
13
17
|
let options = (0, _utils.getOptions)();
|
14
18
|
let {
|
19
|
+
unstableDepsInverse,
|
15
20
|
docs: {
|
16
21
|
componentFolder,
|
22
|
+
disableES5Transpile,
|
23
|
+
enableChunkHash,
|
17
24
|
cssUniqueness,
|
25
|
+
combinerMq,
|
18
26
|
hasRTL,
|
27
|
+
hoverActive,
|
19
28
|
rtlExclude,
|
20
29
|
cssHashSelectors,
|
21
30
|
classNamePrefix
|
@@ -25,72 +34,61 @@ let {
|
|
25
34
|
}
|
26
35
|
} = options;
|
27
36
|
let appPath = process.cwd();
|
37
|
+
const nameTemplate = (0, _configsAssetsLoaders.createNameTemplate)(enableChunkHash);
|
28
38
|
|
29
39
|
module.exports = isSSTest => ({
|
30
40
|
entry: {
|
31
|
-
main: [_path.default.resolve(__dirname,
|
32
|
-
vendor: [
|
41
|
+
main: [_path.default.resolve(__dirname, '..', 'hooks', 'docsProptypeHook.js'), _path.default.join(appPath, componentFolder, 'index.js')],
|
42
|
+
vendor: ['react', 'react-dom', 'redux', 'react-redux']
|
33
43
|
},
|
34
|
-
devtool:
|
35
|
-
mode:
|
44
|
+
devtool: 'none',
|
45
|
+
mode: 'development',
|
36
46
|
output: {
|
37
|
-
path: _path.default.join(appPath,
|
38
|
-
filename:
|
39
|
-
publicPath:
|
40
|
-
library:
|
41
|
-
libraryTarget:
|
47
|
+
path: _path.default.join(appPath, 'build'),
|
48
|
+
filename: 'js/[name].js',
|
49
|
+
publicPath: '/docs/',
|
50
|
+
library: 'Component',
|
51
|
+
libraryTarget: 'umd'
|
42
52
|
},
|
43
53
|
plugins: (0, _pluginUtils.getDocsPlugins)(isSSTest, options),
|
44
54
|
module: {
|
45
55
|
rules: [{
|
46
56
|
test: /\.js$/,
|
47
57
|
use: [{
|
48
|
-
loader:
|
58
|
+
loader: 'babel-loader',
|
49
59
|
options: {
|
50
|
-
presets: [[require.resolve(
|
60
|
+
presets: [[require.resolve('@babel/preset-env'), {
|
51
61
|
modules: false
|
52
|
-
}], require.resolve(
|
53
|
-
plugins: [[require.resolve(
|
62
|
+
}], require.resolve('@babel/preset-react')],
|
63
|
+
plugins: [[require.resolve('@babel/plugin-transform-runtime'), {
|
54
64
|
helpers: true,
|
55
65
|
regenerator: false
|
56
|
-
}], require.resolve(
|
66
|
+
}], require.resolve('@babel/plugin-syntax-dynamic-import'), require.resolve('@babel/plugin-syntax-object-rest-spread')],
|
57
67
|
cacheDirectory: true
|
58
68
|
}
|
59
69
|
}],
|
60
70
|
include: _path.default.join(appPath, folder)
|
61
71
|
}, {
|
62
72
|
test: /\.docs\.js$/,
|
63
|
-
use: require.resolve(
|
73
|
+
use: require.resolve('../loaders/docsLoader.js'),
|
64
74
|
include: _path.default.join(appPath, folder),
|
65
75
|
exclude: /node_modules/
|
66
76
|
}, {
|
67
77
|
test: /(\.module)?\.css$/,
|
68
|
-
use: (0, _loaderUtils.getCSSLoaders)(hasRTL, rtlExclude, false, cssUniqueness, null, cssHashSelectors, classNamePrefix)
|
69
|
-
}, {
|
70
|
-
test: /\.jpe?g$|\.gif$|\.png$/,
|
71
|
-
use: ["url-loader?limit=1000&name=./images/[name].[ext]"]
|
72
|
-
}, {
|
73
|
-
test: /\.woff2|\.woff$|\.ttf$|\.eot$/,
|
74
|
-
use: ["url-loader?limit=1000&name=./fonts/[name].[ext]"]
|
75
|
-
}, {
|
76
|
-
test: /\.svg$/,
|
77
|
-
use: ["url-loader?limit=1&name=./fonts/[name].[ext]"]
|
78
|
-
}, {
|
78
|
+
use: (0, _loaderUtils.getCSSLoaders)(hasRTL, combinerMq, rtlExclude, hoverActive, false, cssUniqueness, null, cssHashSelectors, classNamePrefix)
|
79
|
+
}, (0, _configsAssetsLoaders.configImageLoader)(nameTemplate), (0, _configsAssetsLoaders.configFontLoader)(nameTemplate), (0, _configsAssetsLoaders.configSVGLoader)(nameTemplate), (0, _configsAssetsLoaders.configAudioLoader)(nameTemplate), {
|
79
80
|
test: /\.html$/,
|
80
81
|
use: {
|
81
|
-
loader:
|
82
|
+
loader: 'html-loader',
|
82
83
|
options: {
|
83
|
-
attrs: [
|
84
|
-
interpolate:
|
84
|
+
attrs: [':data-src'],
|
85
|
+
interpolate: 'require'
|
85
86
|
}
|
86
87
|
}
|
87
|
-
}, {
|
88
|
-
test: /\.ogg$/,
|
89
|
-
use: ["file-loader?name=./fonts/[name].[ext]"]
|
90
88
|
}, {
|
91
89
|
test: /\.tmpl$/,
|
92
90
|
use: [{
|
93
|
-
loader:
|
91
|
+
loader: 'html-loader',
|
94
92
|
options: {
|
95
93
|
minimize: {
|
96
94
|
removeComments: true,
|
@@ -104,12 +102,13 @@ module.exports = isSSTest => ({
|
|
104
102
|
}]
|
105
103
|
},
|
106
104
|
externals: {
|
107
|
-
ZC:
|
105
|
+
ZC: '$ZC'
|
108
106
|
},
|
109
107
|
resolve: {
|
110
|
-
modules: [_path.default.resolve(__dirname,
|
108
|
+
modules: unstableDepsInverse ? ['node_modules', _path.default.resolve(__dirname, '..', '..', 'node_modules')] : [_path.default.resolve(__dirname, '..', '..', 'node_modules'), 'node_modules'],
|
109
|
+
alias: disableES5Transpile ? _libAlias.libAlias : {}
|
111
110
|
},
|
112
111
|
resolveLoader: {
|
113
|
-
modules: [_path.default.resolve(__dirname,
|
112
|
+
modules: unstableDepsInverse ? ['node_modules', _path.default.resolve(__dirname, '..', '..', 'node_modules')] : [_path.default.resolve(__dirname, '..', '..', 'node_modules'), 'node_modules']
|
114
113
|
}
|
115
114
|
});
|
@@ -8,6 +8,8 @@ var _loaderUtils = require("../loaderUtils");
|
|
8
8
|
|
9
9
|
var _getLibraryImactPlugins = _interopRequireDefault(require("../pluginUtils/getLibraryImactPlugins"));
|
10
10
|
|
11
|
+
var _configsAssetsLoaders = require("../loaderUtils/configsAssetsLoaders");
|
12
|
+
|
11
13
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
12
14
|
|
13
15
|
let options = (0, _utils.getOptions)();
|
@@ -17,7 +19,10 @@ let {
|
|
17
19
|
cssUniqueness,
|
18
20
|
hasRTL,
|
19
21
|
rtlExclude,
|
22
|
+
hoverActive,
|
23
|
+
combinerMq,
|
20
24
|
cssHashSelectors,
|
25
|
+
enableChunkHash,
|
21
26
|
classNamePrefix
|
22
27
|
},
|
23
28
|
app: {
|
@@ -25,6 +30,7 @@ let {
|
|
25
30
|
}
|
26
31
|
} = options;
|
27
32
|
let appPath = process.cwd();
|
33
|
+
const nameTemplate = (0, _configsAssetsLoaders.createNameTemplate)(enableChunkHash);
|
28
34
|
module.exports = {
|
29
35
|
entry: {
|
30
36
|
main: [_path.default.resolve(__dirname, '..', 'hooks', 'docsProptypeHook.js'), _path.default.join(appPath, componentFolder, 'index.js')],
|
@@ -64,17 +70,8 @@ module.exports = {
|
|
64
70
|
exclude: /node_modules/
|
65
71
|
}, {
|
66
72
|
test: /(\.module)?\.css$/,
|
67
|
-
use: (0, _loaderUtils.getCSSLoaders)(hasRTL, rtlExclude, false, cssUniqueness, null, cssHashSelectors, classNamePrefix)
|
68
|
-
}, {
|
69
|
-
test: /\.jpe?g$|\.gif$|\.png$/,
|
70
|
-
use: ['url-loader?limit=1000&name=./images/[name].[ext]']
|
71
|
-
}, {
|
72
|
-
test: /\.woff2|\.woff$|\.ttf$|\.eot$/,
|
73
|
-
use: ['url-loader?limit=1000&name=./fonts/[name].[ext]']
|
74
|
-
}, {
|
75
|
-
test: /\.svg$/,
|
76
|
-
use: ['url-loader?limit=1&name=./fonts/[name].[ext]']
|
77
|
-
}, {
|
73
|
+
use: (0, _loaderUtils.getCSSLoaders)(hasRTL, rtlExclude, combinerMq, hoverActive, false, cssUniqueness, null, cssHashSelectors, classNamePrefix)
|
74
|
+
}, (0, _configsAssetsLoaders.configImageLoader)(nameTemplate), (0, _configsAssetsLoaders.configFontLoader)(nameTemplate), (0, _configsAssetsLoaders.configSVGLoader)(nameTemplate), (0, _configsAssetsLoaders.configAudioLoader)(nameTemplate), {
|
78
75
|
test: /\.html$/,
|
79
76
|
use: {
|
80
77
|
loader: 'html-loader',
|
@@ -83,9 +80,6 @@ module.exports = {
|
|
83
80
|
interpolate: 'require'
|
84
81
|
}
|
85
82
|
}
|
86
|
-
}, {
|
87
|
-
test: /\.ogg$/,
|
88
|
-
use: ['file-loader?name=./fonts/[name].[ext]']
|
89
83
|
}, {
|
90
84
|
test: /\.tmpl$/,
|
91
85
|
use: [{
|
@@ -17,6 +17,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
17
17
|
// import TerserPlugin from 'terser-webpack-plugin';
|
18
18
|
let options = (0, _utils.getOptions)();
|
19
19
|
let {
|
20
|
+
unstableDepsInverse,
|
20
21
|
app: {
|
21
22
|
folder,
|
22
23
|
context,
|
@@ -26,8 +27,10 @@ let {
|
|
26
27
|
removeAttribute,
|
27
28
|
enableSMap,
|
28
29
|
server,
|
30
|
+
combinerMq,
|
29
31
|
hasRTL,
|
30
32
|
rtlExclude,
|
33
|
+
hoverActive,
|
31
34
|
cssUniqueness,
|
32
35
|
server: {
|
33
36
|
mode
|
@@ -80,7 +83,7 @@ module.exports = {
|
|
80
83
|
concatenateModules: true,
|
81
84
|
minimize: true,
|
82
85
|
// by default if minimize: true in webpack minimize then webpack automaticaly add TerserPlugin,
|
83
|
-
// So we are overrideing it.
|
86
|
+
// So we are overrideing it.
|
84
87
|
// minimizer: [
|
85
88
|
// new TerserPlugin({
|
86
89
|
// cache: true,
|
@@ -143,10 +146,10 @@ module.exports = {
|
|
143
146
|
}, seperateCssModules ? {
|
144
147
|
test: /\.css$/,
|
145
148
|
exclude: /\.module\.css$/,
|
146
|
-
use: (0, _loaderUtils.getCSSLoaders)(hasRTL, rtlExclude, '[local]', false, null)
|
149
|
+
use: (0, _loaderUtils.getCSSLoaders)(hasRTL, rtlExclude, hoverActive, combinerMq, '[local]', false, null)
|
147
150
|
} : null, {
|
148
151
|
test: seperateCssModules ? /\.module\.css$/ : /\.css$/,
|
149
|
-
use: (0, _loaderUtils.getCSSLoaders)(hasRTL, rtlExclude, false, cssUniqueness, selectorReplace, cssHashSelectors, classNamePrefix)
|
152
|
+
use: (0, _loaderUtils.getCSSLoaders)(hasRTL, combinerMq, rtlExclude, hoverActive, false, cssUniqueness, selectorReplace, cssHashSelectors, classNamePrefix)
|
150
153
|
}, {
|
151
154
|
test: /\.jpe?g$|\.gif$|\.png$/,
|
152
155
|
use: [{
|
@@ -208,10 +211,10 @@ module.exports = {
|
|
208
211
|
ZC: '$ZC'
|
209
212
|
},
|
210
213
|
resolve: {
|
211
|
-
modules: [_path.default.resolve(__dirname, '..', '..', 'node_modules'), 'node_modules'],
|
214
|
+
modules: unstableDepsInverse ? ['node_modules', _path.default.resolve(__dirname, '..', '..', 'node_modules')] : [_path.default.resolve(__dirname, '..', '..', 'node_modules'), 'node_modules'],
|
212
215
|
alias: disableES5Transpile ? _libAlias.libAlias : {}
|
213
216
|
},
|
214
217
|
resolveLoader: {
|
215
|
-
modules: [_path.default.resolve(__dirname, '..', '..', 'node_modules'), 'node_modules']
|
218
|
+
modules: unstableDepsInverse ? ['node_modules', _path.default.resolve(__dirname, '..', '..', 'node_modules')] : [_path.default.resolve(__dirname, '..', '..', 'node_modules'), 'node_modules']
|
216
219
|
}
|
217
220
|
};
|