/* * SonarQube * Copyright (C) 2009-2020 SonarSource SA * mailto:info AT sonarsource DOT com * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* eslint-disable import/no-extraneous-dependencies, complexity */ const path = require('path'); const CleanWebpackPlugin = require('clean-webpack-plugin'); const CopyWebpackPlugin = require('copy-webpack-plugin'); const MiniCssExtractPlugin = require('mini-css-extract-plugin'); const HtmlWebpackPlugin = require('html-webpack-plugin'); const LodashPlugin = require('lodash-webpack-plugin'); const webpack = require('webpack'); const InterpolateHtmlPlugin = require('./InterpolateHtmlPlugin'); const paths = require('./paths'); const utils = require('./utils'); /* This webpack config is actually two: one for modern browsers and one for the legacy ones (e.g. ie11) The modern one transpilies the code to ES2018 (i.e. with classes, async functions, etc.) and does not include any polyfills. It's included in the result index.html using