Skip to content

Commit 87017b4

Browse files
author
Adam Butterworth
authored
feat: add a babel-preserve-modules config preset (#11)
1 parent a74a525 commit 87017b4

File tree

2 files changed

+39
-1
lines changed

2 files changed

+39
-1
lines changed
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
module.exports = {
2+
presets: [
3+
[
4+
'@babel/preset-env',
5+
{
6+
modules: false,
7+
},
8+
],
9+
'@babel/preset-react',
10+
],
11+
plugins: [
12+
'@babel/plugin-proposal-object-rest-spread',
13+
'@babel/plugin-proposal-class-properties',
14+
'@babel/plugin-syntax-dynamic-import',
15+
],
16+
env: {
17+
i18n: {
18+
plugins: [
19+
[
20+
'react-intl',
21+
{
22+
messagesDir: './temp/babel-plugin-react-intl',
23+
moduleSourceName: '@edx/frontend-i18n',
24+
},
25+
],
26+
],
27+
},
28+
test: {
29+
presets: [
30+
'@babel/preset-env',
31+
],
32+
},
33+
},
34+
};

lib/presets.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,13 @@ module.exports = {
1414
configFile: getConfigFilepath('jest.config.js'),
1515
},
1616
babel: {
17-
globSearchPattern: 'babel.config.js',
17+
globSearchPattern: '(babel.config.js|.babelrc*)',
1818
configFile: getConfigFilepath('babel.config.js'),
1919
},
20+
'babel-preserve-modules': {
21+
globSearchPattern: '(babel.config.js|.babelrc*)',
22+
configFile: getConfigFilepath('babel-preserve-modules.config.js'),
23+
},
2024
'webpack-prod': {
2125
globSearchPattern: 'webpack.prod.config.js',
2226
configFile: getConfigFilepath('webpack.prod.config.js'),

0 commit comments

Comments
 (0)