@zohodesk/react-cli 1.1.14-exp.3 → 1.1.14-kubernetes
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +16 -281
- package/bin/cli.js +55 -30
- package/docs/CustomChunks.md +9 -12
- package/docs/SelectorWeight.md +0 -3
- package/docs/ValueReplacer.md +0 -27
- package/docs/VariableConversion.md +1 -6
- package/lib/common/splitChunks.js +45 -65
- package/lib/common/testPattern.js +11 -9
- package/lib/common/valueReplacer.js +3 -1
- package/lib/configs/resolvers.js +5 -16
- package/lib/configs/webpack.css.umd.config.js +2 -3
- package/lib/configs/webpack.dev.config.js +5 -15
- package/lib/configs/webpack.docs.config.js +3 -14
- package/lib/configs/webpack.impact.config.js +2 -8
- package/lib/configs/webpack.prod.config.js +5 -15
- package/lib/constants.js +3 -3
- package/lib/loaderUtils/getCSSLoaders.js +49 -98
- package/lib/loaderUtils/windowsModification.js +1 -6
- package/lib/loaders/docsLoader.js +7 -18
- package/lib/loaders/selectorMappingLoader.js +9 -9
- package/lib/pluginUtils/getDevPlugins.js +6 -25
- package/lib/pluginUtils/getProdPlugins.js +5 -32
- package/lib/pluginUtils/getUMDCSSPlugins.js +1 -1
- package/lib/pluginUtils/getUMDComponentPlugins.js +1 -1
- package/lib/plugins/EFCPlugin.js +9 -9
- package/lib/plugins/EFCTemplatePlugin.js +12 -10
- package/lib/plugins/I18NInjectIntoIndexPlugin.js +9 -8
- package/lib/plugins/I18nSplitPlugin/I18nDebugPlugin.js +3 -2
- package/lib/plugins/I18nSplitPlugin/I18nDownlodLogic.js +13 -30
- package/lib/plugins/I18nSplitPlugin/I18nKeysIdentifer.js +7 -2
- package/lib/plugins/I18nSplitPlugin/index.js +1 -1
- package/lib/plugins/I18nSplitPlugin/utils/propertiesUtils.js +8 -8
- package/lib/plugins/ReportGeneratePlugin.js +6 -8
- package/lib/plugins/ResourceHintsPlugin.js +3 -13
- package/lib/plugins/SelectorPlugin.js +37 -77
- package/lib/plugins/{MinifyPlugin.js → UglifyCSSPlugin.js} +3 -3
- package/lib/plugins/UnusedFilesFindPlugin.js +5 -7
- package/lib/plugins/VariableConversionCollector.js +101 -40
- package/lib/plugins/composeCommonPlugin.js +30 -0
- package/lib/plugins/index.js +7 -7
- package/lib/postcss-plugins/ExcludePlugin.js +1 -1
- package/lib/postcss-plugins/RTLSplitPlugin.js +10 -4
- package/lib/postcss-plugins/ValueReplacer.js +29 -8
- package/lib/postcss-plugins/hoverActivePlugin.js +6 -0
- package/lib/postcss-plugins/variableModificationPlugin/ErrorHandler.js +1 -0
- package/lib/postcss-plugins/variableModificationPlugin/index.js +38 -94
- package/lib/postcss-plugins/variableModifier.js +244 -0
- package/lib/schemas/index.js +18 -94
- package/lib/servers/devBuild.js +11 -13
- package/lib/servers/getCliPath.js +5 -3
- package/lib/servers/httpsOptions.js +13 -12
- package/lib/servers/nowatchserver.js +55 -62
- package/lib/servers/server.js +52 -53
- package/lib/utils/cssClassNameGenerate.js +13 -70
- package/lib/utils/getOptions.js +28 -35
- package/lib/utils/getServerURL.js +9 -1
- package/lib/utils/index.js +12 -14
- package/lib/utils/initPreCommitHook.js +5 -5
- package/lib/utils/pullOrigin.js +3 -3
- package/lib/utils/reinstallDependencies.js +3 -3
- package/lib/utils/switchBranch.js +2 -4
- package/package.json +3 -5
- package/templates/docs/all.html +0 -1
- package/templates/docs/component.html +0 -1
- package/templates/docs/components.html +0 -1
- package/templates/docs/css/style.css +169 -136
- package/templates/docs/index.html +632 -796
- package/.vscode/settings.json +0 -25
- package/docs/ComposeMinification.md +0 -13
- package/docs/MarkdownParser.md +0 -18
- package/docs/ReactLive.md +0 -14
- package/docs/patternFiltering.md +0 -57
- package/lib/common/buildEs.js +0 -12
- package/lib/common/runPreProcess.js +0 -71
- package/lib/deprecationLogger.js +0 -40
- package/lib/loaderUtils/tests/windowsModification.test.js +0 -10
- package/lib/loaders/__test__/markdownLoader.spec.js +0 -145
- package/lib/loaders/composeLoader.js +0 -298
- package/lib/loaders/markdownLoader.js +0 -71
- package/lib/loaders/reactLiveConvertor.js +0 -105
- package/lib/logger.js +0 -27
- package/lib/plugins/CustomAttributePlugin.js +0 -82
- package/lib/plugins/CustomAttributePlugin.md +0 -35
- package/lib/plugins/EfcResourceCleanupPlugin.js +0 -43
- package/lib/plugins/StatsPlugin.js +0 -82
- package/lib/plugins/utils/classHandling.js +0 -35
- package/lib/plugins/utils/fileHandling.js +0 -92
- package/lib/plugins/utils/tests/fileHandling.test.js +0 -30
- package/lib/plugins/variableConvertorUtils.js +0 -133
- package/lib/postcss-plugins/EmptyPlugin.js +0 -8
- package/lib/postcss-plugins/IncludePlugin.js +0 -23
- package/lib/postcss-plugins/SelectorReplace.js +0 -80
- package/lib/postcss-plugins/__test__/selectorReplace.test.js +0 -28
- package/lib/postcss-plugins/__test__/valueReplacer.spec.js +0 -43
- package/lib/servers/requireLocalOrGlobal.js +0 -61
- package/lib/utils/deprecationSupport.js +0 -134
- package/lib/utils/log.js +0 -11
- package/lib/utils/object-manipulation.js +0 -88
- package/lib/utils/selectorReplacer.js +0 -47
- package/lib/utils/variableConverter.js +0 -104
- package/npm-shrinkwrap.json +0 -33485
- package/templates/docs/css/markdown.css +0 -202
@@ -15,53 +15,35 @@ var _testPattern = require("./testPattern");
|
|
15
15
|
|
16
16
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
17
17
|
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
18
|
+
let isWindows = _os.default.platform().toLowerCase() === 'win32';
|
19
|
+
let ps = _path.default.sep;
|
20
|
+
let options = (0, _utils.getOptions)();
|
21
|
+
let {
|
22
22
|
app: {
|
23
23
|
vendorExclude,
|
24
24
|
customChunks,
|
25
|
-
vendorInclude
|
26
|
-
customChunksBaseConfig
|
25
|
+
vendorInclude
|
27
26
|
}
|
28
27
|
} = options;
|
29
|
-
const reactBundleIncludeList = ['react', 'react-dom', 'react-redux', 'react-transition-group', 'scheduler', 'prop-types'];
|
30
|
-
const vendorExcludeList = ['script-loader', 'raw-loader', ...reactBundleIncludeList, ...vendorExclude.map(vendorPath => vendorPath.replace(/[/\\]/g, _path.default.sep))];
|
31
|
-
const vendorIncludeList = [...vendorInclude].map(vendorPath => vendorPath.replace(/[/\\]/g, _path.default.sep));
|
32
28
|
|
33
|
-
|
34
|
-
|
29
|
+
let isVendor = function isVendor(module) {
|
30
|
+
let {
|
35
31
|
userRequest
|
36
32
|
} = module;
|
37
|
-
|
33
|
+
let excludeList = ['script-loader', 'raw-loader', 'react', 'react-dom'];
|
34
|
+
excludeList = [...excludeList, ...vendorExclude];
|
35
|
+
return userRequest && (vendorInclude.some(item => userRequest.indexOf(item) !== -1) || userRequest.indexOf('node_modules') >= 0 && userRequest.endsWith('.css') === false && userRequest.endsWith('publicPathConfig.js') === false && excludeList.every(item => userRequest.indexOf(`node_modules${ps}${item}${ps}`) === -1));
|
38
36
|
};
|
39
37
|
|
40
|
-
|
41
|
-
|
38
|
+
let isReact = module => {
|
39
|
+
let {
|
42
40
|
userRequest
|
43
41
|
} = module;
|
44
|
-
|
42
|
+
let reactBundle = ['react', 'react-dom'];
|
43
|
+
return userRequest && reactBundle.some(pkg => userRequest.indexOf(`node_modules${ps}${pkg}${ps}`) >= 0);
|
45
44
|
};
|
46
45
|
|
47
|
-
|
48
|
-
if (typeof pattern === 'function') {
|
49
|
-
return pattern;
|
50
|
-
}
|
51
|
-
|
52
|
-
if (Array.isArray(pattern)) {
|
53
|
-
return ({
|
54
|
-
userRequest
|
55
|
-
}) => (0, _testPattern.testPattern)(userRequest, pattern);
|
56
|
-
}
|
57
|
-
|
58
|
-
return new RegExp(isWindows ? pattern.replace(/\//g, '\\') : pattern);
|
59
|
-
}
|
60
|
-
|
61
|
-
const baseSplitChunkConfig = Object.assign({
|
62
|
-
minSize: 15000
|
63
|
-
}, customChunksBaseConfig);
|
64
|
-
const specificCacheGroupConfig = {
|
46
|
+
let defaultChunks = {
|
65
47
|
'react.vendor': {
|
66
48
|
name: 'react.vendor',
|
67
49
|
chunks: 'all',
|
@@ -81,35 +63,45 @@ const specificCacheGroupConfig = {
|
|
81
63
|
priority: -10
|
82
64
|
}
|
83
65
|
};
|
84
|
-
|
66
|
+
let customChunksConfig = {};
|
85
67
|
customChunks.map((obj, index) => ({
|
86
68
|
name: obj.name,
|
87
|
-
chunks: obj.chunks || 'all',
|
88
|
-
minChunks: obj.minChunks || obj.size || 2,
|
89
69
|
pattern: obj.pattern,
|
70
|
+
minChunks: obj.minChunks || obj.size || 2,
|
71
|
+
rules: obj.rules,
|
72
|
+
// includeDepenency: obj.includeDepenency || false,
|
90
73
|
priority: obj.priority || -10 * (index + 2),
|
91
|
-
enforce: obj.enforce,
|
92
|
-
minSize: obj.minSize,
|
93
|
-
// || 20000,
|
74
|
+
enforce: obj.enforce || true,
|
94
75
|
maxSize: obj.maxSize,
|
95
76
|
// || 0,
|
96
|
-
|
97
|
-
|
98
|
-
|
77
|
+
minSize: obj.minSize,
|
78
|
+
// || 20000,
|
79
|
+
chunks: obj.chunks || 'all'
|
80
|
+
})).map(({
|
99
81
|
name,
|
100
|
-
chunks = 'all',
|
101
|
-
minChunks,
|
102
82
|
pattern,
|
83
|
+
minChunks,
|
84
|
+
rules,
|
103
85
|
priority,
|
86
|
+
// includeDepenency,
|
104
87
|
enforce,
|
105
88
|
minSize,
|
106
89
|
maxSize,
|
107
|
-
|
108
|
-
cacheGroupName
|
90
|
+
chunks = 'all'
|
109
91
|
}) => {
|
110
|
-
|
111
|
-
|
92
|
+
let obj = {
|
93
|
+
name,
|
94
|
+
test: rules ? m => {
|
95
|
+
const {
|
96
|
+
userRequest
|
97
|
+
} = m;
|
98
|
+
return (0, _testPattern.testPattern)(userRequest, rules); // return (
|
99
|
+
// pkgs.some(p => isRelated(userRequest, p)) ||
|
100
|
+
// (includeDepenency && isDependency(m, pkgs))
|
101
|
+
// );
|
102
|
+
} : new RegExp(isWindows ? pattern.replace(/\//g, '\\') : pattern),
|
112
103
|
chunks,
|
104
|
+
enforce,
|
113
105
|
minChunks,
|
114
106
|
priority
|
115
107
|
};
|
@@ -122,25 +114,13 @@ customChunks.map((obj, index) => ({
|
|
122
114
|
obj.maxSize = maxSize;
|
123
115
|
}
|
124
116
|
|
125
|
-
|
126
|
-
obj.enforce = true;
|
127
|
-
}
|
128
|
-
|
129
|
-
if (name !== undefined) {
|
130
|
-
obj.name = name;
|
131
|
-
}
|
132
|
-
|
133
|
-
if (reuseExistingChunk !== undefined) {
|
134
|
-
obj.reuseExistingChunk = reuseExistingChunk;
|
135
|
-
}
|
136
|
-
|
137
|
-
customChunksConfig[cacheGroupName] = obj;
|
117
|
+
return customChunksConfig[name] = obj;
|
138
118
|
});
|
139
|
-
|
119
|
+
var _default = {
|
120
|
+
minSize: 12000,
|
140
121
|
cacheGroups: Object.assign({
|
141
122
|
default: false,
|
142
123
|
vendors: false
|
143
|
-
},
|
144
|
-
}
|
145
|
-
var _default = splitChunkConfig;
|
124
|
+
}, defaultChunks, customChunksConfig)
|
125
|
+
};
|
146
126
|
exports.default = _default;
|
@@ -13,25 +13,25 @@ var _path = require("path");
|
|
13
13
|
const isWindows = _path.sep !== '/'; // this function will return true if pattern matched
|
14
14
|
|
15
15
|
function _testPattern(req, pattern) {
|
16
|
-
let
|
16
|
+
let modifyedPattern = pattern;
|
17
17
|
|
18
|
-
if (/[*.$^]/.test(
|
18
|
+
if (/[*.$^]/.test(modifyedPattern)) {
|
19
19
|
if (isWindows) {
|
20
|
-
//
|
21
|
-
|
20
|
+
// modifyedPattern = pattern.replace(/\//g, ps.replace(/\\/g, '\\\\'));
|
21
|
+
modifyedPattern = modifyedPattern.replace(/\//g, '\\\\');
|
22
22
|
}
|
23
23
|
|
24
|
-
|
25
|
-
const re = new RegExp(
|
24
|
+
modifyedPattern = modifyedPattern.replace(/\./g, '\\.').replace(/\*/g, '.*');
|
25
|
+
const re = new RegExp(modifyedPattern);
|
26
26
|
return re.test(req);
|
27
27
|
}
|
28
28
|
|
29
29
|
if (isWindows) {
|
30
|
-
//
|
31
|
-
|
30
|
+
// modifyedPattern = pattern.replace(/\//g, ps.replace(/\\/g, '\\\\'));
|
31
|
+
modifyedPattern = modifyedPattern.replace(/\//g, '\\');
|
32
32
|
}
|
33
33
|
|
34
|
-
return req.indexOf(
|
34
|
+
return req.indexOf(modifyedPattern) !== -1;
|
35
35
|
}
|
36
36
|
|
37
37
|
function testPattern(req, pattern) {
|
@@ -62,6 +62,8 @@ const isRelatedPackage = (req, item) => isRelated(req, `node_modules${_path.sep}
|
|
62
62
|
exports.isRelatedPackage = isRelatedPackage;
|
63
63
|
|
64
64
|
function isDependency(m, excludeList) {
|
65
|
+
// let reasons = m.reasons.map(r => r.module.userRequest);
|
66
|
+
// m.reasons.some(r => !r.module || !r.module.userRequest) && console.log(m.reasons);
|
65
67
|
return m.reasons.some(r => excludeList.some(item => r.module && isRelated(r.module.userRequest, item)));
|
66
68
|
} // export function queryHandler(conditions, pattern) {
|
67
69
|
// }
|
@@ -32,9 +32,11 @@ if (!_fs.default.existsSync(dist)) {
|
|
32
32
|
}
|
33
33
|
|
34
34
|
(0, _folderIterator.default)(src, dist, docopy ? false : ['.css'], false, (fromPath, toPath) => {
|
35
|
-
|
35
|
+
//console.log({ fromPath: fromPath, toPath: toPath });
|
36
|
+
let css = _fs.default.readFileSync(fromPath);
|
36
37
|
|
37
38
|
if (docopy && !fromPath.endsWith('.css')) {
|
39
|
+
//console.log(toPath,'....');
|
38
40
|
_fs.default.writeFileSync(toPath, css);
|
39
41
|
|
40
42
|
return;
|
package/lib/configs/resolvers.js
CHANGED
@@ -8,10 +8,6 @@ exports.moduleResolver = moduleResolver;
|
|
8
8
|
|
9
9
|
var _constants = require("../constants");
|
10
10
|
|
11
|
-
var _logger = require("../logger");
|
12
|
-
|
13
|
-
var _requireLocalOrGlobal = require("../servers/requireLocalOrGlobal");
|
14
|
-
|
15
11
|
var _libAlias = require("./libAlias");
|
16
12
|
|
17
13
|
var _client_packages_group = require("@zohodesk/client_packages_group");
|
@@ -21,19 +17,12 @@ function moduleResolver(options) {
|
|
21
17
|
moduleResolvePath,
|
22
18
|
disableES5Transpile
|
23
19
|
} = options.app;
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
required = (0, _requireLocalOrGlobal.requireGlobal)('@zohodesk/client_packages_group');
|
28
|
-
|
29
|
-
if (required) {
|
30
|
-
(0, _logger.messageLogger)('global `@zohodesk/client_packages_group` package taken as client_packages_group');
|
31
|
-
}
|
32
|
-
}
|
20
|
+
const nodeModulesPath = moduleResolvePath ? require(require.resolve(moduleResolvePath, {
|
21
|
+
paths: [options.cwd]
|
22
|
+
})).nodeModulesPath : _client_packages_group.nodeModulesPath; // const {unstableDepsInverse} = options;
|
33
23
|
|
34
|
-
const nodeModulesPath = required ? required.nodeModulesPath : _client_packages_group.nodeModulesPath;
|
35
24
|
return {
|
36
|
-
modules: [nodeModulesPath, _constants.
|
25
|
+
modules: [nodeModulesPath, _constants.cliNodemodulesPath, 'node_modules'].filter(Boolean),
|
37
26
|
alias: disableES5Transpile ? _libAlias.libAlias : {} // alias: { ...libAlias, ...clientDependenies }
|
38
27
|
|
39
28
|
};
|
@@ -45,7 +34,7 @@ function loaderResolver(options) {
|
|
45
34
|
unstableDepsInverse
|
46
35
|
} = options;
|
47
36
|
return {
|
48
|
-
modules: unstableDepsInverse ? ['node_modules', _constants.
|
37
|
+
modules: unstableDepsInverse ? ['node_modules', _constants.cliNodemodulesPath] : [_constants.cliNodemodulesPath, 'node_modules'] // alias: libAlias
|
49
38
|
|
50
39
|
};
|
51
40
|
}
|
@@ -23,8 +23,7 @@ let {
|
|
23
23
|
folder,
|
24
24
|
publicPath,
|
25
25
|
cssHashSelectors,
|
26
|
-
classNamePrefix
|
27
|
-
customClassNamePrefix
|
26
|
+
classNamePrefix
|
28
27
|
}
|
29
28
|
},
|
30
29
|
packageVersion
|
@@ -84,7 +83,7 @@ module.exports = {
|
|
84
83
|
loader: 'css-loader',
|
85
84
|
options: {
|
86
85
|
modules: {
|
87
|
-
getLocalIdent: (0, _cssClassNameGenerate.default)(cssUniqueness, cssHashSelectors, classNamePrefix
|
86
|
+
getLocalIdent: (0, _cssClassNameGenerate.default)(cssUniqueness, cssHashSelectors, classNamePrefix)
|
88
87
|
}
|
89
88
|
}
|
90
89
|
}]
|
@@ -25,12 +25,10 @@ const {
|
|
25
25
|
outputFolder,
|
26
26
|
plugins,
|
27
27
|
exclude,
|
28
|
-
patterns,
|
29
28
|
mediaQueryHoverActiveString,
|
30
29
|
cssVariableReplacementConfig,
|
31
30
|
selectorWeightConfig,
|
32
31
|
cssUniqueness,
|
33
|
-
customClassNamePrefix,
|
34
32
|
seperateCssModules,
|
35
33
|
changeRuntimeChunkChar,
|
36
34
|
// we are going to use this for fonts file name collide in issue in devmode
|
@@ -40,9 +38,7 @@ const {
|
|
40
38
|
selectorReplace,
|
41
39
|
devConsoleExculde,
|
42
40
|
sourcemap,
|
43
|
-
crossorigin
|
44
|
-
postCssPluginOrder,
|
45
|
-
externals
|
41
|
+
crossorigin
|
46
42
|
}
|
47
43
|
} = options;
|
48
44
|
const {
|
@@ -106,32 +102,26 @@ module.exports = {
|
|
106
102
|
use: (0, _loaderUtils.getCSSLoaders)({
|
107
103
|
plugins,
|
108
104
|
exclude,
|
109
|
-
patterns,
|
110
105
|
mediaQueryHoverActiveString,
|
111
106
|
cssVariableReplacementConfig,
|
112
107
|
selectorWeightConfig,
|
113
|
-
customClassNamePrefix,
|
114
108
|
classNameBlob: '[local]',
|
115
109
|
cssUniqueness: false,
|
116
|
-
selectorReplace: null
|
117
|
-
postCssPluginOrder
|
110
|
+
selectorReplace: null
|
118
111
|
})
|
119
112
|
} : null, {
|
120
113
|
test: seperateCssModules ? /\.module\.css$/ : /(\.module)?\.css$/,
|
121
114
|
use: (0, _loaderUtils.getCSSLoaders)({
|
122
115
|
plugins,
|
123
116
|
exclude,
|
124
|
-
patterns,
|
125
117
|
mediaQueryHoverActiveString,
|
126
118
|
cssVariableReplacementConfig,
|
127
119
|
selectorWeightConfig,
|
128
120
|
classNameBlob: null,
|
129
121
|
cssUniqueness,
|
130
|
-
customClassNamePrefix,
|
131
122
|
selectorReplace,
|
132
123
|
cssHashSelectors,
|
133
|
-
classNamePrefix
|
134
|
-
postCssPluginOrder
|
124
|
+
classNamePrefix
|
135
125
|
})
|
136
126
|
}, (0, _configsAssetsLoaders.configImageLoader)(nameTemplate), (0, _configsAssetsLoaders.configFontLoader)(nameTemplate), (0, _configsAssetsLoaders.configSVGLoader)(nameTemplate), (0, _configsAssetsLoaders.configVideoLoader)(nameTemplate), (0, _configsAssetsLoaders.configAudioLoader)(nameTemplate), {
|
137
127
|
test: /\.tmpl$/,
|
@@ -152,9 +142,9 @@ module.exports = {
|
|
152
142
|
}
|
153
143
|
}].filter(Boolean)
|
154
144
|
},
|
155
|
-
externals:
|
145
|
+
externals: {
|
156
146
|
ZC: '$ZC'
|
157
|
-
},
|
147
|
+
},
|
158
148
|
resolve: (0, _resolvers.moduleResolver)(options),
|
159
149
|
resolveLoader: (0, _resolvers.loaderResolver)(options)
|
160
150
|
};
|
@@ -20,17 +20,13 @@ const {
|
|
20
20
|
componentFolder,
|
21
21
|
enableChunkHash,
|
22
22
|
cssUniqueness,
|
23
|
-
customClassNamePrefix,
|
24
23
|
plugins,
|
25
24
|
exclude,
|
26
|
-
patterns,
|
27
25
|
mediaQueryHoverActiveString,
|
28
26
|
cssVariableReplacementConfig,
|
29
27
|
selectorWeightConfig,
|
30
28
|
cssHashSelectors,
|
31
|
-
classNamePrefix
|
32
|
-
selectorReplace,
|
33
|
-
postCssPluginOrder
|
29
|
+
classNamePrefix
|
34
30
|
},
|
35
31
|
app: {
|
36
32
|
folder
|
@@ -81,17 +77,14 @@ module.exports = isSSTest => ({
|
|
81
77
|
use: (0, _loaderUtils.getCSSLoaders)({
|
82
78
|
plugins,
|
83
79
|
exclude,
|
84
|
-
patterns,
|
85
80
|
mediaQueryHoverActiveString,
|
86
81
|
cssVariableReplacementConfig,
|
87
82
|
selectorWeightConfig,
|
88
83
|
classNameBlob: false,
|
89
84
|
cssUniqueness,
|
90
|
-
|
91
|
-
selectorReplace,
|
85
|
+
selectorReplace: null,
|
92
86
|
cssHashSelectors,
|
93
|
-
classNamePrefix
|
94
|
-
postCssPluginOrder
|
87
|
+
classNamePrefix
|
95
88
|
})
|
96
89
|
}, (0, _configsAssetsLoaders.configImageLoader)(nameTemplate), (0, _configsAssetsLoaders.configFontLoader)(nameTemplate), (0, _configsAssetsLoaders.configSVGLoader)(nameTemplate), (0, _configsAssetsLoaders.configAudioLoader)(nameTemplate), (0, _configsAssetsLoaders.configVideoLoader)(nameTemplate), {
|
97
90
|
test: /\.html$/,
|
@@ -102,10 +95,6 @@ module.exports = isSSTest => ({
|
|
102
95
|
interpolate: 'require'
|
103
96
|
}
|
104
97
|
}
|
105
|
-
}, {
|
106
|
-
test: /\.mjs$/,
|
107
|
-
include: /node_modules/,
|
108
|
-
type: 'javascript/auto'
|
109
98
|
}, {
|
110
99
|
test: /\.tmpl$/,
|
111
100
|
use: [{
|
@@ -19,17 +19,14 @@ const {
|
|
19
19
|
docs: {
|
20
20
|
componentFolder,
|
21
21
|
cssUniqueness,
|
22
|
-
customClassNamePrefix,
|
23
22
|
plugins,
|
24
23
|
exclude,
|
25
|
-
patterns,
|
26
24
|
mediaQueryHoverActiveString,
|
27
25
|
cssVariableReplacementConfig,
|
28
26
|
selectorWeightConfig,
|
29
27
|
cssHashSelectors,
|
30
28
|
enableChunkHash,
|
31
|
-
classNamePrefix
|
32
|
-
postCssPluginOrder
|
29
|
+
classNamePrefix
|
33
30
|
},
|
34
31
|
app: {
|
35
32
|
folder
|
@@ -80,17 +77,14 @@ module.exports = {
|
|
80
77
|
use: (0, _loaderUtils.getCSSLoaders)({
|
81
78
|
plugins,
|
82
79
|
exclude,
|
83
|
-
patterns,
|
84
80
|
mediaQueryHoverActiveString,
|
85
81
|
cssVariableReplacementConfig,
|
86
82
|
selectorWeightConfig,
|
87
83
|
classNameBlob: false,
|
88
84
|
cssUniqueness,
|
89
|
-
customClassNamePrefix,
|
90
85
|
selectorReplace: null,
|
91
86
|
cssHashSelectors,
|
92
|
-
classNamePrefix
|
93
|
-
postCssPluginOrder
|
87
|
+
classNamePrefix
|
94
88
|
})
|
95
89
|
}, (0, _configsAssetsLoaders.configImageLoader)(nameTemplate), (0, _configsAssetsLoaders.configFontLoader)(nameTemplate), (0, _configsAssetsLoaders.configSVGLoader)(nameTemplate), (0, _configsAssetsLoaders.configAudioLoader)(nameTemplate), (0, _configsAssetsLoaders.configVideoLoader)(nameTemplate), {
|
96
90
|
test: /\.html$/,
|
@@ -29,12 +29,10 @@ const {
|
|
29
29
|
server,
|
30
30
|
plugins,
|
31
31
|
exclude,
|
32
|
-
patterns,
|
33
32
|
mediaQueryHoverActiveString,
|
34
33
|
cssVariableReplacementConfig,
|
35
34
|
selectorWeightConfig,
|
36
35
|
cssUniqueness,
|
37
|
-
customClassNamePrefix,
|
38
36
|
server: {
|
39
37
|
mode
|
40
38
|
},
|
@@ -45,9 +43,7 @@ const {
|
|
45
43
|
selectorReplace,
|
46
44
|
removePropTypes,
|
47
45
|
devConsoleExculde,
|
48
|
-
crossorigin
|
49
|
-
postCssPluginOrder,
|
50
|
-
externals
|
46
|
+
crossorigin
|
51
47
|
}
|
52
48
|
} = options;
|
53
49
|
let {
|
@@ -157,32 +153,26 @@ module.exports = {
|
|
157
153
|
use: (0, _loaderUtils.getCSSLoaders)({
|
158
154
|
plugins,
|
159
155
|
exclude,
|
160
|
-
patterns,
|
161
156
|
cssVariableReplacementConfig,
|
162
157
|
selectorWeightConfig,
|
163
158
|
mediaQueryHoverActiveString,
|
164
159
|
classNameBlob: '[local]',
|
165
160
|
cssUniqueness: false,
|
166
|
-
|
167
|
-
selectorReplace: null,
|
168
|
-
postCssPluginOrder
|
161
|
+
selectorReplace: null
|
169
162
|
})
|
170
163
|
} : null, {
|
171
164
|
test: seperateCssModules ? /\.module\.css$/ : /\.css$/,
|
172
165
|
use: (0, _loaderUtils.getCSSLoaders)({
|
173
166
|
plugins,
|
174
167
|
exclude,
|
175
|
-
patterns,
|
176
168
|
mediaQueryHoverActiveString,
|
177
169
|
cssVariableReplacementConfig,
|
178
170
|
selectorWeightConfig,
|
179
171
|
classNameBlob: false,
|
180
172
|
cssUniqueness,
|
181
|
-
customClassNamePrefix,
|
182
173
|
selectorReplace,
|
183
174
|
cssHashSelectors,
|
184
|
-
classNamePrefix
|
185
|
-
postCssPluginOrder
|
175
|
+
classNamePrefix
|
186
176
|
})
|
187
177
|
}, {
|
188
178
|
test: /\.jpe?g$|\.gif$|\.png$/,
|
@@ -241,9 +231,9 @@ module.exports = {
|
|
241
231
|
}
|
242
232
|
}].filter(Boolean)
|
243
233
|
},
|
244
|
-
externals:
|
234
|
+
externals: {
|
245
235
|
ZC: '$ZC'
|
246
|
-
}
|
236
|
+
},
|
247
237
|
resolve: (0, _resolvers.moduleResolver)(options),
|
248
238
|
resolveLoader: (0, _resolvers.loaderResolver)(options)
|
249
239
|
};
|
package/lib/constants.js
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
4
4
|
value: true
|
5
5
|
});
|
6
|
-
exports.cliRootPath = exports.
|
6
|
+
exports.cliRootPath = exports.cliNodemodulesPath = exports.appPath = exports.CONFIG_ROOT = exports.BASE_CONFIG_KEY = void 0;
|
7
7
|
|
8
8
|
var _path = _interopRequireDefault(require("path"));
|
9
9
|
|
@@ -18,10 +18,10 @@ exports.cliRootPath = cliRootPath;
|
|
18
18
|
const CONFIG_ROOT = 'react-cli';
|
19
19
|
exports.CONFIG_ROOT = CONFIG_ROOT;
|
20
20
|
|
21
|
-
const
|
21
|
+
const cliNodemodulesPath = _path.default.resolve(cliRootPath, 'node_modules'); // export const babelrcPath = join(cliRootPath, '.babelrc');
|
22
22
|
|
23
23
|
|
24
|
-
exports.
|
24
|
+
exports.cliNodemodulesPath = cliNodemodulesPath;
|
25
25
|
const appPath = process.cwd(); // export const appInitialHTMLTemplatePath = path.join(
|
26
26
|
// process.cwd(),
|
27
27
|
// 'src',
|