forked from visgl/loaders.gl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbabel.config.js
31 lines (28 loc) · 997 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
const {getBabelConfig, deepMerge} = require('ocular-dev-tools');
module.exports = (api) => {
const defaultConfig = getBabelConfig(api, {react: true});
const config = deepMerge(defaultConfig, {
plugins: [
// webpack 4 cannot parse the most recent JS syntax
'@babel/plugin-proposal-optional-chaining',
'@babel/plugin-proposal-nullish-coalescing-operator',
// typescript supports class properties
'@babel/plugin-proposal-class-properties',
// inject __VERSION__ from package.json
'version-inline'
],
ignore: [
// Don't transpile workers, they are transpiled separately
'**/*.worker.js',
'**/workers/*.js',
// Don't transpile files in libs, we use this folder to store external,
// already transpiled and minified libraries and scripts.
// e.g. draco, basis, las-perf etc.
/src\/libs/,
// babel can't process .d.ts
/\.d\.ts$/
]
});
// console.debug(config);
return config;
};