@digest/jest-babel 4.14.4 → 4.14.5-beta.1
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/package.json +3 -3
- package/dist/babelPrep.d.ts +0 -1
- package/dist/babelPrep.js +0 -67
- package/dist/index.js +0 -3
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@digest/jest-babel",
|
|
3
3
|
"title": "Jest Babel Digest",
|
|
4
4
|
"license": "LGPL-3.0-or-later",
|
|
5
|
-
"version": "4.14.
|
|
5
|
+
"version": "4.14.5-beta.1",
|
|
6
6
|
"description": "Digested Jest Babel configurations",
|
|
7
7
|
"author": "wallzero @wallzeroblog (http://wallzero.com)",
|
|
8
8
|
"contributors": [
|
|
@@ -40,12 +40,12 @@
|
|
|
40
40
|
"@digest/babel": "^4.0.0",
|
|
41
41
|
"@digest/jest": "^4.0.0",
|
|
42
42
|
"@digest/scripts": "^4.0.0",
|
|
43
|
-
"babel-jest": "^30.0
|
|
43
|
+
"babel-jest": "^30.2.0"
|
|
44
44
|
},
|
|
45
45
|
"keywords": [
|
|
46
46
|
"digest",
|
|
47
47
|
"jest",
|
|
48
48
|
"babel"
|
|
49
49
|
],
|
|
50
|
-
"gitHead": "
|
|
50
|
+
"gitHead": "a1d0041df4dd60b1d85f330e1ee9f3246330d06e"
|
|
51
51
|
}
|
package/dist/babelPrep.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist/babelPrep.js
DELETED
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const scripts_1 = require("@digest/scripts");
|
|
4
|
-
const DISABLE_PLUGINS = {
|
|
5
|
-
'@babel/plugin-syntax-dynamic-import': true,
|
|
6
|
-
'@babel/plugin-transform-regenerator': true,
|
|
7
|
-
'@babel/plugin-transform-typescript': true,
|
|
8
|
-
'@dr.pogodin/babel-plugin-react-css-modules': true,
|
|
9
|
-
'babel-plugin-react-remove-properties': true,
|
|
10
|
-
'babel-plugin-transform-inline-environment-variables': true,
|
|
11
|
-
'babel-plugin-transform-node-env-inline': true
|
|
12
|
-
};
|
|
13
|
-
const DISABLE_PRESETS = {
|
|
14
|
-
'babel-preset-minify': true
|
|
15
|
-
};
|
|
16
|
-
const babelPrep = function (api) {
|
|
17
|
-
let babelConfig;
|
|
18
|
-
if (scripts_1.config.babel) {
|
|
19
|
-
babelConfig = require(scripts_1.config.babel)(api);
|
|
20
|
-
}
|
|
21
|
-
if (babelConfig) {
|
|
22
|
-
const preparedBabelConfig = Object.assign(Object.assign({}, babelConfig), { plugins: babelConfig.plugins ?
|
|
23
|
-
babelConfig.plugins.filter((plugin) => {
|
|
24
|
-
if (Array.isArray(plugin)) {
|
|
25
|
-
return !DISABLE_PLUGINS[plugin[0]];
|
|
26
|
-
}
|
|
27
|
-
return false;
|
|
28
|
-
}) :
|
|
29
|
-
[], presets: babelConfig.presets ?
|
|
30
|
-
babelConfig.presets.filter((preset) => {
|
|
31
|
-
if (Array.isArray(preset)) {
|
|
32
|
-
return !DISABLE_PRESETS[preset[0]];
|
|
33
|
-
}
|
|
34
|
-
return false;
|
|
35
|
-
}) :
|
|
36
|
-
[] });
|
|
37
|
-
const presetIndex = preparedBabelConfig.presets.findIndex((preset) => {
|
|
38
|
-
if (Array.isArray(preset)) {
|
|
39
|
-
return preset[0] === '@babel/preset-env';
|
|
40
|
-
}
|
|
41
|
-
return false;
|
|
42
|
-
});
|
|
43
|
-
if (scripts_1.config.cssModules &&
|
|
44
|
-
scripts_1.config.react) {
|
|
45
|
-
preparedBabelConfig.plugins.push([
|
|
46
|
-
'@dr.pogodin/babel-plugin-react-css-modules',
|
|
47
|
-
{
|
|
48
|
-
context: scripts_1.config.context,
|
|
49
|
-
generateScopedName: '[local]'
|
|
50
|
-
}
|
|
51
|
-
]);
|
|
52
|
-
}
|
|
53
|
-
if (scripts_1.config.babelPolyfills &&
|
|
54
|
-
presetIndex > -1) {
|
|
55
|
-
preparedBabelConfig.presets[presetIndex][1].modules = 'commonjs';
|
|
56
|
-
preparedBabelConfig.presets[presetIndex][1].targets = 'node 11';
|
|
57
|
-
}
|
|
58
|
-
else {
|
|
59
|
-
preparedBabelConfig.plugins.unshift([
|
|
60
|
-
'@babel/plugin-transform-modules-commonjs'
|
|
61
|
-
]);
|
|
62
|
-
}
|
|
63
|
-
return preparedBabelConfig;
|
|
64
|
-
}
|
|
65
|
-
return {};
|
|
66
|
-
};
|
|
67
|
-
module.exports = babelPrep;
|
package/dist/index.js
DELETED