-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathbabel.config.js
More file actions
26 lines (24 loc) · 850 Bytes
/
babel.config.js
File metadata and controls
26 lines (24 loc) · 850 Bytes
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
// https://www.wisdomgeek.com/development/web-development/how-to-setup-jest-typescript-babel-webpack-project/
module.exports = (api) => {
/**
* Cache the returned value forever and don't call this function again. This is the default behavior but since we
* are reading the env value above, we need to explicitly set it after we are done doing that, else we get a
* caching was left unconfigured error.
*/
api.cache(true);
return {
presets: [
[
// Allows smart transpilation according to target environments
'@babel/preset-env',
{
// Specifying which browser versions you want to transpile down to
targets: '> 0.25%, not dead',
modules: 'commonjs',
},
],
// Enabling Babel to understand TypeScript
'@babel/preset-typescript',
],
};
};