merge branch heads and added ui-polyfill

This commit is contained in:
Sebastian Sdorra
2019-10-11 07:34:19 +02:00
parent 3b3d842fc9
commit 49a7aab45c
6 changed files with 50 additions and 11 deletions

View File

@@ -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"

View File

@@ -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"
}
}];

View File

@@ -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 <sebastian.sdorra@cloudogu.com>",
"license": "BSD-3-Clause",
"private": true,
"dependencies": {
"@babel/polyfill": "^7.6.0",
"whatwg-fetch": "^3.0.0"
}
}

View File

@@ -0,0 +1,2 @@
import "@babel/polyfill";
import "whatwg-fetch";

View File

@@ -13,6 +13,19 @@
<base href="{{ contextPath }}">
<title>SCM-Manager</title>
<script>
var modernBrowser = (
'fetch' in window &&
'assign' in Object
);
if ( !modernBrowser ) {
var scriptElement = document.createElement("script");
scriptElement.async = false;
scriptElement.src = "{{ contextPath }}/polyfills.bundle.js";
document.head.appendChild(scriptElement);
}
</script>
</head>
<body>
<noscript>

View File

@@ -731,7 +731,7 @@
"@babel/helper-regex" "^7.4.4"
regexpu-core "^4.6.0"
"@babel/polyfill@^7.0.0":
"@babel/polyfill@^7.0.0", "@babel/polyfill@^7.6.0":
version "7.6.0"
resolved "https://registry.yarnpkg.com/@babel/polyfill/-/polyfill-7.6.0.tgz#6d89203f8b6cd323e8d946e47774ea35dc0619cc"
integrity sha512-q5BZJI0n/B10VaQQvln1IlDK3BTBJFbADx7tv+oXDPIDZuTo37H5Adb9jhlXm/fEN4Y7/64qD9mnrJJG7rmaTw==