aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/babel.config.legacy.js
diff options
context:
space:
mode:
authorStas Vilchik <stas.vilchik@sonarsource.com>2018-12-18 15:51:21 +0100
committersonartech <sonartech@sonarsource.com>2018-12-20 11:41:49 +0100
commit9c3818394a97ff1b9d8e92f781bcd4a911ee9838 (patch)
treef41cc866a2fafd5b0dfba65cc668c723c64b41c9 /server/sonar-web/babel.config.legacy.js
parent687c3b52b21afb9f7e8e80b4329921b1bfef1257 (diff)
downloadsonarqube-9c3818394a97ff1b9d8e92f781bcd4a911ee9838.tar.gz
sonarqube-9c3818394a97ff1b9d8e92f781bcd4a911ee9838.zip
create a separate js bundle for legacy browsers (#1073)
Diffstat (limited to 'server/sonar-web/babel.config.legacy.js')
-rw-r--r--server/sonar-web/babel.config.legacy.js49
1 files changed, 49 insertions, 0 deletions
diff --git a/server/sonar-web/babel.config.legacy.js b/server/sonar-web/babel.config.legacy.js
new file mode 100644
index 00000000000..2c525fffc4b
--- /dev/null
+++ b/server/sonar-web/babel.config.legacy.js
@@ -0,0 +1,49 @@
+module.exports = {
+ presets: [
+ [
+ '@babel/preset-env',
+ {
+ modules: false,
+ targets: {
+ browsers: [
+ 'last 3 Chrome versions',
+ 'last 3 Firefox versions',
+ 'last 3 Safari versions',
+ 'last 3 Edge versions',
+ 'IE 11'
+ ]
+ },
+ useBuiltIns: 'entry'
+ }
+ ],
+ '@babel/preset-react'
+ ],
+ plugins: [
+ '@babel/plugin-proposal-class-properties',
+ ['@babel/plugin-proposal-object-rest-spread', { useBuiltIns: true }],
+ 'lodash'
+ ],
+ env: {
+ production: {
+ plugins: [
+ '@babel/plugin-syntax-dynamic-import',
+ '@babel/plugin-transform-react-constant-elements'
+ ]
+ },
+ development: {
+ plugins: [
+ '@babel/plugin-syntax-dynamic-import',
+ '@babel/plugin-transform-react-jsx-source',
+ '@babel/plugin-transform-react-jsx-self'
+ ]
+ },
+ test: {
+ plugins: [
+ '@babel/plugin-transform-modules-commonjs',
+ 'dynamic-import-node',
+ '@babel/plugin-transform-react-jsx-source',
+ '@babel/plugin-transform-react-jsx-self'
+ ]
+ }
+ }
+};