diff --git a/scm-plugins/scm-git-plugin/webpack.config.js b/scm-plugins/scm-git-plugin/webpack.config.js index ff25222591..a535ed60f5 100644 --- a/scm-plugins/scm-git-plugin/webpack.config.js +++ b/scm-plugins/scm-git-plugin/webpack.config.js @@ -34,12 +34,7 @@ module.exports = { use: { loader: "babel-loader", options: { - presets: [ - "@babel/preset-env", - "@babel/preset-react", - "@babel/preset-flow" - ], - plugins: ["@babel/plugin-proposal-class-properties"] + presets: ["@scm-manager/babel-preset"] } } }, @@ -61,7 +56,13 @@ module.exports = { ] }, output: { - path: path.join(__dirname, "target", "scm-git-plugin-2.0.0-SNAPSHOT", "webapp", "assets"), + path: path.join( + __dirname, + "target", + "scm-git-plugin-2.0.0-SNAPSHOT", + "webapp", + "assets" + ), filename: "[name].bundle.js", library: "scm-git-plugin", libraryTarget: "amd" diff --git a/scm-ui/scripts/webpack.config.js b/scm-ui/scripts/webpack.config.js index 6e473f40a6..2707432be2 100644 --- a/scm-ui/scripts/webpack.config.js +++ b/scm-ui/scripts/webpack.config.js @@ -2,7 +2,7 @@ const path = require("path"); const createIndexMiddleware = require("./IndexMiddleware"); const createContextPathMiddleware = require("./ContextPathMiddleware"); -module.exports = { +module.exports = [{ context: path.resolve(__dirname, ".."), entry: { webapp: [ @@ -99,7 +99,8 @@ module.exports = { cacheGroups: { vendors: { test: /[\\/]node_modules[\\/]/, - priority: -10 + priority: -10, + // chunks: chunk => chunk.name !== "polyfill" }, default: { minChunks: 2, @@ -109,4 +110,13 @@ module.exports = { } } } -}; +}, { + context: path.resolve(__dirname, ".."), + entry: { + polyfill: "./ui-polyfill/src/index.js" + }, + output: { + path: path.resolve(__dirname, "..", "target", "assets"), + filename: "[name].bundle.js" + } +}]; diff --git a/scm-ui/ui-polyfill/package.json b/scm-ui/ui-polyfill/package.json new file mode 100644 index 0000000000..2e90564c9f --- /dev/null +++ b/scm-ui/ui-polyfill/package.json @@ -0,0 +1,13 @@ +{ + "name": "@scm-manager/ui-polyfill", + "version": "2.0.0-SNAPSHOT", + "description": "Polyfills for SCM-Manager UI", + "main": "src/index.js", + "author": "Sebastian Sdorra ", + "license": "BSD-3-Clause", + "private": true, + "dependencies": { + "@babel/polyfill": "^7.6.0", + "whatwg-fetch": "^3.0.0" + } +} diff --git a/scm-ui/ui-polyfill/src/index.js b/scm-ui/ui-polyfill/src/index.js new file mode 100644 index 0000000000..ad6c931796 --- /dev/null +++ b/scm-ui/ui-polyfill/src/index.js @@ -0,0 +1,2 @@ +import "@babel/polyfill"; +import "whatwg-fetch"; diff --git a/scm-ui/ui-webapp/public/index.mustache b/scm-ui/ui-webapp/public/index.mustache index 0698a303e1..bfb9f5fe3c 100644 --- a/scm-ui/ui-webapp/public/index.mustache +++ b/scm-ui/ui-webapp/public/index.mustache @@ -13,6 +13,19 @@ SCM-Manager + +