From 7b5e8646eb1d4928b4c96a16c831982640a980b4 Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Tue, 5 Mar 2019 18:07:51 -0800 Subject: [PATCH] Transpile UI for old browsers --- frontend/gulp/webpack.js | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/frontend/gulp/webpack.js b/frontend/gulp/webpack.js index c3e3069ba..11589c9f3 100644 --- a/frontend/gulp/webpack.js +++ b/frontend/gulp/webpack.js @@ -7,8 +7,8 @@ const errorHandler = require('./helpers/errorHandler'); const MiniCssExtractPlugin = require('mini-css-extract-plugin'); const uiFolder = 'UI'; -const srcFolder = path.join(__dirname, '..', 'src'); const frontendFolder = path.join(__dirname, '..'); +const srcFolder = path.join(frontendFolder, 'src'); const isProduction = process.argv.indexOf('--production') > -1; console.log('Source Folder:', srcFolder); @@ -89,7 +89,24 @@ const config = { loader: 'babel-loader', options: { configFile: `${frontendFolder}/babel.config.js`, - envName: isProduction ? 'production' : 'development' + envName: isProduction ? 'production' : 'development', + presets: [ + [ + '@babel/preset-env', + { + modules: false, + loose: true, + debug: false, + useBuiltIns: 'entry', + targets: [ + '>0.25%', + 'not ie 11', + 'not op_mini all', + 'not chrome < 60' + ] + } + ] + ] } } ]