forked from plone/volto
-
Notifications
You must be signed in to change notification settings - Fork 0
/
babel.js
34 lines (33 loc) · 825 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
module.exports = function (api) {
api.cache(true);
const presets = ['razzle/babel'];
const plugins = [
[
'@babel/plugin-transform-react-jsx',
{
runtime: 'automatic',
},
],
'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-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,
};
};