@zohodesk/react-cli 1.1.21 → 1.1.22-exp.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.
|
@@ -23,7 +23,7 @@ const {
|
|
|
23
23
|
const isProd = mode.toLowerCase() === 'prod';
|
|
24
24
|
const defaultPlugins = [[require.resolve('babel-plugin-transform-define'), isProd ? {
|
|
25
25
|
__DOCS__: false
|
|
26
|
-
} : {}], require.resolve('@babel/plugin-syntax-dynamic-import')];
|
|
26
|
+
} : {}], require.resolve('@babel/plugin-syntax-dynamic-import'), require.resolve('../utils/addModulePathAlias')];
|
|
27
27
|
const resolvedPlugins = [];
|
|
28
28
|
babelPlugins.forEach(plugin => {
|
|
29
29
|
resolvedPlugins.push(require.resolve(plugin));
|
|
@@ -24,7 +24,7 @@ const {
|
|
|
24
24
|
const isProd = mode.toLowerCase() === 'prod';
|
|
25
25
|
const defaultPlugins = [[require.resolve('babel-plugin-transform-define'), isProd ? {
|
|
26
26
|
__DOCS__: false
|
|
27
|
-
} : {}], require.resolve('@babel/plugin-syntax-dynamic-import')];
|
|
27
|
+
} : {}], require.resolve('@babel/plugin-syntax-dynamic-import'), require.resolve('../utils/addModulePathAlias')];
|
|
28
28
|
const resolvedPlugins = [];
|
|
29
29
|
babelPlugins.forEach(plugin => {
|
|
30
30
|
resolvedPlugins.push(require.resolve(plugin));
|
package/lib/configs/resolvers.js
CHANGED
|
@@ -21,6 +21,7 @@ function moduleResolver(options) {
|
|
|
21
21
|
moduleResolvePath,
|
|
22
22
|
disableES5Transpile
|
|
23
23
|
} = options.app;
|
|
24
|
+
const customAlias = options.app.alias;
|
|
24
25
|
let required = moduleResolvePath && (0, _requireLocalOrGlobal.requireLocal)(moduleResolvePath);
|
|
25
26
|
|
|
26
27
|
if (!required) {
|
|
@@ -32,9 +33,11 @@ function moduleResolver(options) {
|
|
|
32
33
|
}
|
|
33
34
|
|
|
34
35
|
const nodeModulesPath = required ? required.nodeModulesPath : _client_packages_group.nodeModulesPath;
|
|
36
|
+
const totalAlias = Object.assign({}, _libAlias.libAlias, customAlias);
|
|
35
37
|
return {
|
|
38
|
+
extensions: ['.js', '.jsx', '.ts', '.tsx'],
|
|
36
39
|
modules: [nodeModulesPath, _constants.cliNodeModulesPath, 'node_modules'].filter(Boolean),
|
|
37
|
-
alias: disableES5Transpile ?
|
|
40
|
+
alias: disableES5Transpile ? totalAlias : {} // alias: { ...libAlias, ...clientDependenies }
|
|
38
41
|
|
|
39
42
|
};
|
|
40
43
|
}
|
package/lib/schemas/index.js
CHANGED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _getOptions = _interopRequireDefault(require("./getOptions"));
|
|
4
|
+
|
|
5
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
6
|
+
|
|
7
|
+
const options = (0, _getOptions.default)();
|
|
8
|
+
const alias = options.app.alias;
|
|
9
|
+
|
|
10
|
+
module.exports = () => ({
|
|
11
|
+
visitor: {
|
|
12
|
+
ImportDeclaration(path) {
|
|
13
|
+
const source = path.node.source.value;
|
|
14
|
+
const aliasName = Object.keys(alias);
|
|
15
|
+
aliasName.forEach(name => {
|
|
16
|
+
if (source.includes(name)) {
|
|
17
|
+
path.node.source.value = source.replace(name, alias[name]);
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
}
|
|
23
|
+
});
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zohodesk/react-cli",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.22",
|
|
4
4
|
"lockfileVersion": 2,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "@zohodesk/react-cli",
|
|
9
|
-
"version": "1.1.
|
|
9
|
+
"version": "1.1.22",
|
|
10
10
|
"license": "ISC",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@babel/cli": "7.10.5",
|