]> cat aescling's git repositories - mastodon.git/blob - babel.config.js
Bump nokogiri from 1.9.1 to 1.10.0 (#9757)
[mastodon.git] / babel.config.js
1 module.exports = (api) => {
2 const env = api.env();
3
4 const envOptions = {
5 debug: false,
6 loose: true,
7 modules: false,
8 };
9
10 const config = {
11 presets: [
12 '@babel/react',
13 ['@babel/env', envOptions],
14 ],
15 plugins: [
16 '@babel/syntax-dynamic-import',
17 ['@babel/proposal-object-rest-spread', { useBuiltIns: true }],
18 ['@babel/proposal-decorators', { legacy: true }],
19 '@babel/proposal-class-properties',
20 ['react-intl', { messagesDir: './build/messages' }],
21 'preval',
22 ],
23 };
24
25 switch (env) {
26 case 'production':
27 envOptions.debug = false;
28 config.plugins.push(...[
29 'lodash',
30 [
31 'transform-react-remove-prop-types',
32 {
33 mode: 'remove',
34 removeImport: true,
35 additionalLibraries: [
36 'react-immutable-proptypes',
37 ],
38 },
39 ],
40 '@babel/transform-react-inline-elements',
41 [
42 '@babel/transform-runtime',
43 {
44 helpers: true,
45 regenerator: false,
46 useESModules: true,
47 },
48 ],
49 ]);
50 break;
51 case 'development':
52 envOptions.debug = true;
53 config.plugins.push(...[
54 '@babel/transform-react-jsx-source',
55 '@babel/transform-react-jsx-self',
56 ]);
57 break;
58 case 'test':
59 envOptions.modules = 'commonjs';
60 break;
61 }
62
63 return config;
64 };
65
This page took 0.13265 seconds and 4 git commands to generate.