@zohodesk/react-cli 1.1.20-exp.6 → 1.1.20-exp.7
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/lib/babel/cmjs-plugins-presets.js +4 -9
- package/lib/babel/es-plugins-presets.js +4 -9
- package/lib/configs/webpack.dev.config.js +3 -3
- package/lib/configs/webpack.prod.config.js +4 -4
- package/lib/jest/preProcessors/jsPreprocessor.js +25 -2
- package/lib/loaderUtils/getDevJsLoaders.js +2 -2
- package/lib/schemas/index.js +7 -7
- package/npm-shrinkwrap.json +7247 -12050
- package/package.json +1 -1
|
@@ -15,14 +15,11 @@ const {
|
|
|
15
15
|
module: {
|
|
16
16
|
mode
|
|
17
17
|
},
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
18
|
+
babelCustomizationForLibrary: {
|
|
19
|
+
babelPlugins
|
|
20
|
+
},
|
|
21
|
+
enableTypeScript
|
|
22
22
|
} = (0, _utils.getOptions)();
|
|
23
|
-
const {
|
|
24
|
-
babelPlugins
|
|
25
|
-
} = babelCustomizationForLibrary;
|
|
26
23
|
const isProd = mode.toLowerCase() === 'prod';
|
|
27
24
|
const defaultPlugins = [[require.resolve('babel-plugin-transform-define'), isProd ? {
|
|
28
25
|
__DOCS__: false
|
|
@@ -40,8 +37,6 @@ if (enableTypeScript) {
|
|
|
40
37
|
presets.push(require.resolve('@babel/preset-typescript'));
|
|
41
38
|
}
|
|
42
39
|
|
|
43
|
-
console.log(presets, plugins);
|
|
44
|
-
|
|
45
40
|
var _default = () => ({
|
|
46
41
|
presets: presets,
|
|
47
42
|
plugins: plugins
|
|
@@ -16,14 +16,11 @@ const {
|
|
|
16
16
|
mode,
|
|
17
17
|
disableES5Transpile
|
|
18
18
|
},
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
19
|
+
babelCustomizationForLibrary: {
|
|
20
|
+
babelPlugins
|
|
21
|
+
},
|
|
22
|
+
enableTypeScript
|
|
23
23
|
} = (0, _utils.getOptions)();
|
|
24
|
-
const {
|
|
25
|
-
babelPlugins
|
|
26
|
-
} = babelCustomizationForLibrary;
|
|
27
24
|
const isProd = mode.toLowerCase() === 'prod';
|
|
28
25
|
const defaultPlugins = [[require.resolve('babel-plugin-transform-define'), isProd ? {
|
|
29
26
|
__DOCS__: false
|
|
@@ -50,8 +47,6 @@ if (enableTypeScript) {
|
|
|
50
47
|
presets.push(require.resolve('@babel/preset-typescript'));
|
|
51
48
|
}
|
|
52
49
|
|
|
53
|
-
console.log(presets, plugins);
|
|
54
|
-
|
|
55
50
|
var _default = () => ({
|
|
56
51
|
presets: presets,
|
|
57
52
|
plugins: plugins
|
|
@@ -43,9 +43,9 @@ const {
|
|
|
43
43
|
crossorigin,
|
|
44
44
|
postCssPluginOrder,
|
|
45
45
|
externals,
|
|
46
|
-
enableTypeScript,
|
|
47
46
|
enableMjsLoader
|
|
48
|
-
}
|
|
47
|
+
},
|
|
48
|
+
enableTypeScript
|
|
49
49
|
} = options;
|
|
50
50
|
const {
|
|
51
51
|
disableContextURL
|
|
@@ -148,7 +148,7 @@ module.exports = {
|
|
|
148
148
|
}
|
|
149
149
|
}]
|
|
150
150
|
}, enableTypeScript ? {
|
|
151
|
-
test: /\.ts$/,
|
|
151
|
+
test: /\.ts$|\.tsx$/,
|
|
152
152
|
use: 'ts-loader',
|
|
153
153
|
include: _path.default.join(appPath, folder)
|
|
154
154
|
} : null, {
|
|
@@ -49,9 +49,9 @@ const {
|
|
|
49
49
|
devConsoleExculde,
|
|
50
50
|
crossorigin,
|
|
51
51
|
postCssPluginOrder,
|
|
52
|
-
externals
|
|
53
|
-
|
|
54
|
-
|
|
52
|
+
externals
|
|
53
|
+
},
|
|
54
|
+
enableTypeScript
|
|
55
55
|
} = options;
|
|
56
56
|
let {
|
|
57
57
|
enableChunkHash
|
|
@@ -239,7 +239,7 @@ module.exports = {
|
|
|
239
239
|
}
|
|
240
240
|
}]
|
|
241
241
|
}, enableTypeScript ? {
|
|
242
|
-
test: /\.ts$/,
|
|
242
|
+
test: /\.ts$|\.tsx$/,
|
|
243
243
|
use: 'ts-loader',
|
|
244
244
|
include: _path.default.join(appPath, folder)
|
|
245
245
|
} : null, {
|
|
@@ -4,7 +4,30 @@ var _babelJest = _interopRequireDefault(require("babel-jest"));
|
|
|
4
4
|
|
|
5
5
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
6
6
|
|
|
7
|
+
const getOptions = require('../../../lib/utils/getOptions').default;
|
|
8
|
+
|
|
9
|
+
console.log('water');
|
|
10
|
+
const {
|
|
11
|
+
enableTypeScript,
|
|
12
|
+
babelCustomizationForLibrary
|
|
13
|
+
} = getOptions();
|
|
14
|
+
const {
|
|
15
|
+
babelPlugins
|
|
16
|
+
} = babelCustomizationForLibrary;
|
|
17
|
+
const resolvedPlugins = [];
|
|
18
|
+
babelPlugins.forEach(plugin => {
|
|
19
|
+
resolvedPlugins.push(require.resolve(plugin));
|
|
20
|
+
});
|
|
21
|
+
const presets = [require.resolve('@babel/preset-env'), require.resolve('@babel/preset-react')];
|
|
22
|
+
|
|
23
|
+
if (enableTypeScript) {
|
|
24
|
+
presets.push(require.resolve('@babel/preset-typescript'));
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const defaultPlugins = [require.resolve('babel-plugin-transform-dynamic-import')];
|
|
28
|
+
const plugins = [...defaultPlugins, ...resolvedPlugins];
|
|
29
|
+
console.log(presets, plugins, 'wtru');
|
|
7
30
|
module.exports = _babelJest.default.createTransformer({
|
|
8
|
-
presets:
|
|
9
|
-
plugins:
|
|
31
|
+
presets: presets,
|
|
32
|
+
plugins: plugins
|
|
10
33
|
});
|
package/lib/schemas/index.js
CHANGED
|
@@ -125,13 +125,6 @@ var _default = {
|
|
|
125
125
|
cssDirStatement: null
|
|
126
126
|
},
|
|
127
127
|
app: {
|
|
128
|
-
babelCustomizationForLibrary: {
|
|
129
|
-
babelPlugins: []
|
|
130
|
-
},
|
|
131
|
-
enableTypeScript: {
|
|
132
|
-
value: false,
|
|
133
|
-
cli: 'enable_typescript'
|
|
134
|
-
},
|
|
135
128
|
moduleResolvePath: {
|
|
136
129
|
value: '@zohodesk/client_packages_group',
|
|
137
130
|
cli: 'module_resolve_path'
|
|
@@ -745,6 +738,13 @@ var _default = {
|
|
|
745
738
|
fileName: null,
|
|
746
739
|
options: null,
|
|
747
740
|
excludeKeys: null
|
|
741
|
+
},
|
|
742
|
+
babelCustomizationForLibrary: {
|
|
743
|
+
babelPlugins: ['@babel/plugin-proposal-optional-chaining', '@babel/plugin-proposal-class-properties']
|
|
744
|
+
},
|
|
745
|
+
enableTypeScript: {
|
|
746
|
+
value: true,
|
|
747
|
+
cli: 'enable_typescript'
|
|
748
748
|
}
|
|
749
749
|
};
|
|
750
750
|
exports.default = _default;
|