diff options
author | Starfall <root@starfall.blue> | 2019-12-09 19:07:33 -0600 |
---|---|---|
committer | Starfall <root@starfall.blue> | 2019-12-09 19:09:31 -0600 |
commit | 6b34fcfef7566105e8d80ab5fee0a539c06cddbf (patch) | |
tree | 8fad2d47bf8be255d3c671c40cbfd04c2f55ed03 /babel.config.js | |
parent | 9fbb4af7611aa7836e65ef9f544d341423c15685 (diff) | |
parent | 246addd5b33a172600342af3fb6fb5e4c80ad95e (diff) |
Merge branch 'glitch'`
Diffstat (limited to 'babel.config.js')
-rw-r--r-- | babel.config.js | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/babel.config.js b/babel.config.js index 55efafc40..9be5b547a 100644 --- a/babel.config.js +++ b/babel.config.js @@ -1,30 +1,39 @@ module.exports = (api) => { const env = api.env(); + const reactOptions = { + development: false, + }; + const envOptions = { - debug: false, loose: true, modules: false, + debug: false, }; const config = { presets: [ - '@babel/react', + ['@babel/react', reactOptions], ['@babel/env', envOptions], ], plugins: [ - '@babel/syntax-dynamic-import', - ['@babel/proposal-object-rest-spread', { useBuiltIns: true }], ['@babel/proposal-decorators', { legacy: true }], '@babel/proposal-class-properties', - ['react-intl', { messagesDir: './build/messages/' }], + ['react-intl', { messagesDir: './build/messages' }], 'preval', ], + overrides: [ + { + test: /tesseract\.js/, + presets: [ + ['@babel/env', { ...envOptions, modules: 'commonjs' }], + ], + }, + ], }; switch (env) { case 'production': - envOptions.debug = false; config.plugins.push(...[ 'lodash', [ @@ -49,11 +58,8 @@ module.exports = (api) => { ]); break; case 'development': + reactOptions.development = true; envOptions.debug = true; - config.plugins.push(...[ - '@babel/transform-react-jsx-source', - '@babel/transform-react-jsx-self', - ]); break; case 'test': envOptions.modules = 'commonjs'; |