forked from plone/volto
-
Notifications
You must be signed in to change notification settings - Fork 0
/
babel.js
36 lines (35 loc) · 889 Bytes
/
babel.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
module.exports = function (api) {
api.cache(true);
const presets = [
[
'razzle/babel',
{
'@babel/preset-react': { runtime: 'automatic' },
},
],
];
const plugins = [
'lodash',
'@babel/plugin-proposal-export-default-from', // Stage 1
'@babel/plugin-syntax-export-namespace-from', // Stage 4
'@babel/plugin-proposal-throw-expressions', // Stage 2
'@babel/plugin-proposal-nullish-coalescing-operator', // Stage 4
[
'babel-plugin-root-import', // Required for the ~ imports to work
{
rootPathSuffix: 'src',
},
],
[
'react-intl', // React Intl extractor, required for the whole i18n infrastructure to work
{
messagesDir: './build/messages/',
},
],
'@loadable/babel-plugin', // Required by the @loadable plugin
];
return {
plugins,
presets,
};
};