-
Notifications
You must be signed in to change notification settings - Fork 5.1k
/
Copy pathbabel.config.js
35 lines (34 loc) · 944 Bytes
/
babel.config.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
const path = require('path');
module.exports = function (api) {
api.cache(false);
return {
parserOpts: {
strictMode: true,
},
targets: {
browsers: ['chrome >= 89', 'firefox >= 89'],
},
plugins: [
// `browserify` is old and busted, and doesn't support `??=` (and other
// logical assignment operators). This plugin lets us target es2020-level
// browsers (except we do still end up with transpiled logical assignment
// operators 😭)
'@babel/plugin-transform-logical-assignment-operators',
[
path.resolve(
__dirname,
'development/build/transforms/import-meta-url.js',
),
{
pattern: /^@metamask\/([^/]+)\/dist\/preinstalled-snap\.json$/u,
rootPath: '/snaps/',
},
],
],
presets: [
'@babel/preset-typescript',
'@babel/preset-env',
'@babel/preset-react',
],
};
};