@zohodesk/react-cli 1.0.2 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +19 -0
- package/lib/common/testPattern.js +0 -2
- package/lib/common/valueReplacer.js +1 -3
- package/lib/configs/resolvers.js +14 -3
- package/lib/loaderUtils/getCSSLoaders.js +2 -7
- package/lib/loaders/selectorMappingLoader.js +9 -9
- package/lib/logger.js +20 -0
- package/lib/pluginUtils/getDevPlugins.js +5 -0
- package/lib/pluginUtils/getProdPlugins.js +4 -0
- package/lib/plugins/CustomAttributePlugin.js +82 -0
- package/lib/plugins/CustomAttributePlugin.md +35 -0
- package/lib/plugins/EFCPlugin.js +9 -9
- package/lib/plugins/EFCTemplatePlugin.js +10 -12
- package/lib/plugins/I18NInjectIntoIndexPlugin.js +8 -9
- package/lib/plugins/I18nSplitPlugin/I18nDebugPlugin.js +2 -3
- package/lib/plugins/I18nSplitPlugin/I18nKeysIdentifer.js +2 -7
- package/lib/plugins/I18nSplitPlugin/index.js +1 -1
- package/lib/plugins/I18nSplitPlugin/utils/propertiesUtils.js +8 -8
- package/lib/plugins/SelectorPlugin.js +4 -10
- package/lib/plugins/VariableConversionCollector.js +0 -4
- package/lib/postcss-plugins/IncludePlugin.js +0 -1
- package/lib/postcss-plugins/RTLSplitPlugin.js +4 -10
- package/lib/postcss-plugins/ValueReplacer.js +2 -4
- package/lib/postcss-plugins/hoverActivePlugin.js +0 -6
- package/lib/postcss-plugins/variableModificationPlugin/index.js +1 -2
- package/lib/postcss-plugins/variableModifier.js +24 -58
- package/lib/schemas/index.js +8 -1
- package/lib/servers/devBuild.js +13 -11
- package/lib/servers/httpsOptions.js +12 -13
- package/lib/servers/nowatchserver.js +5 -3
- package/lib/servers/requireLocalOrGlobal.js +61 -0
- package/lib/servers/server.js +1 -3
- package/lib/utils/cssClassNameGenerate.js +9 -10
- package/package-lock.json +14407 -0
- package/package.json +2 -2
- package/result.json +0 -1
- package/unittest/index.html +0 -37
@@ -13,9 +13,9 @@ var _getHash = _interopRequireDefault(require("./getHash"));
|
|
13
13
|
|
14
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
15
15
|
|
16
|
-
|
16
|
+
const isWindows = _os.default.platform().toLowerCase() === 'win32';
|
17
17
|
|
18
|
-
|
18
|
+
const isSelectorPackage = (resourcePath, packages) => {
|
19
19
|
if (!resourcePath.includes('node_modules')) {
|
20
20
|
return false;
|
21
21
|
}
|
@@ -43,9 +43,8 @@ var _default = (unique = true, {
|
|
43
43
|
// NOTE: in build macine we use date as folder path.
|
44
44
|
// So every time we create new build there is path will alway different
|
45
45
|
// in order to minmaze that problem we try in relative path;
|
46
|
-
// console.log('context.resourcePath', context.resourcePath, context);
|
47
46
|
// let contextResourcePath = context.resourcePath;
|
48
|
-
|
47
|
+
const relativePath = _path.default.relative(context.rootContext, context.resourcePath);
|
49
48
|
|
50
49
|
if (context.resourcePath.endsWith('.plain.css')) {
|
51
50
|
return localName;
|
@@ -54,20 +53,20 @@ var _default = (unique = true, {
|
|
54
53
|
|
55
54
|
|
56
55
|
if (unique) {
|
57
|
-
|
56
|
+
const h = (0, _getHash.default)(`${relativePath}-${localName}`, 10);
|
58
57
|
return `${classNamePrefix}${h}`;
|
59
58
|
}
|
60
59
|
/* old production mode end*/
|
61
60
|
|
62
61
|
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
62
|
+
const filePaths = context.resourcePath.split(_path.default.sep);
|
63
|
+
const fileName = filePaths[filePaths.length - 1];
|
64
|
+
const [fileNameWithoutExt] = fileName.split('.');
|
65
|
+
const cleanFileName = fileNameWithoutExt.replace(/-/g, '_').toLowerCase(); //css file has casesensitive selector issue so can't toLowerCase
|
67
66
|
//let local = localName.toLowerCase()
|
68
67
|
|
69
68
|
if (isSelectorPackage(context.resourcePath, packages) || filenames.indexOf(cleanFileName) !== -1) {
|
70
|
-
|
69
|
+
const h = (0, _getHash.default)(`${relativePath}-${localName}`, 10);
|
71
70
|
return `${classNamePrefix}${h}`;
|
72
71
|
}
|
73
72
|
|