@zohodesk/react-cli 1.1.22-exp.3 → 1.1.22-exp.4
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
|
} = (0, _utils.getOptions)();
|
|
24
24
|
const isProd = mode.toLowerCase() === 'prod';
|
|
25
25
|
const defaultPlugins = [[require.resolve('babel-plugin-transform-define'), isProd ? {
|
|
26
|
-
|
|
26
|
+
__DOCS__: false
|
|
27
27
|
} : {}], require.resolve('@babel/plugin-syntax-dynamic-import'), [require.resolve('babel-plugin-module-resolver'), {
|
|
28
28
|
"root": ["./"],
|
|
29
29
|
alias
|
|
@@ -14,7 +14,8 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
14
14
|
const {
|
|
15
15
|
module: {
|
|
16
16
|
mode,
|
|
17
|
-
disableES5Transpile
|
|
17
|
+
disableES5Transpile,
|
|
18
|
+
alias
|
|
18
19
|
},
|
|
19
20
|
babelCustomizationForLibrary: {
|
|
20
21
|
babelPlugins
|
|
@@ -24,7 +25,10 @@ const {
|
|
|
24
25
|
const isProd = mode.toLowerCase() === 'prod';
|
|
25
26
|
const defaultPlugins = [[require.resolve('babel-plugin-transform-define'), isProd ? {
|
|
26
27
|
__DOCS__: false
|
|
27
|
-
} : {}], require.resolve('@babel/plugin-syntax-dynamic-import'), require.resolve('
|
|
28
|
+
} : {}], require.resolve('@babel/plugin-syntax-dynamic-import'), [require.resolve('babel-plugin-module-resolver'), {
|
|
29
|
+
"root": ["./"],
|
|
30
|
+
alias
|
|
31
|
+
}]];
|
|
28
32
|
const resolvedPlugins = [];
|
|
29
33
|
babelPlugins.forEach(plugin => {
|
|
30
34
|
resolvedPlugins.push(require.resolve(plugin));
|
package/package.json
CHANGED
|
@@ -1,23 +0,0 @@
|
|
|
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
|
-
});
|