From 9fb10c7baa5f442db486e995b105c28843e40821 Mon Sep 17 00:00:00 2001 From: Emmanuel Guyot Date: Sat, 20 Jul 2024 19:54:10 +0200 Subject: [PATCH] Adjust the web.config to be path independent --- client/.env | 2 +- client/README.md | 3 ++ client/config-overrides.js | 22 +--------- client/package-lock.json | 87 -------------------------------------- client/package.json | 1 - client/public/web.config | 2 +- 6 files changed, 6 insertions(+), 111 deletions(-) diff --git a/client/.env b/client/.env index 15ca4dca3..ea66f4fca 100644 --- a/client/.env +++ b/client/.env @@ -1,4 +1,4 @@ REACT_APP_VERSION=1.20.0 REACT_APP_SERVER_BASE_URL=http://localhost:1337 -PUBLIC_URL=http://localhost:3000/planka/ +PUBLIC_URL=http://localhost/planka-a-moi/ BASE_URL=/planka/ diff --git a/client/README.md b/client/README.md index d1ee58fe6..c688a4cbc 100755 --- a/client/README.md +++ b/client/README.md @@ -1 +1,4 @@ # Planka client + +IIS install +The build package for IIS requires URL rewrite module [https://www.iis.net/downloads/microsoft/url-rewrite] diff --git a/client/config-overrides.js b/client/config-overrides.js index 115e75a4e..e696b198d 100644 --- a/client/config-overrides.js +++ b/client/config-overrides.js @@ -1,6 +1,5 @@ const fs = require('fs'); const path = require('path'); -const CopyPlugin = require('copy-webpack-plugin'); const BASE_URL_PLACEHOLDER = 'BASE_URL_PLACEHOLDER'; @@ -52,26 +51,7 @@ module.exports = function override(config, env) { return { ...config, output: { ...config.output, publicPath: BASE_URL_PLACEHOLDER }, - plugins: [ - ...plugins, - { apply: replaceBaseUrl }, - new CopyPlugin({ - patterns: [ - { - from: 'public/web.config', - transform: { - transformer(content, absoluteFrom) { - const PUBLIC_PATH = process.env.PUBLIC_URL.replace( - /^.*\/\/[^/]*(.*)[^?#]*.*$/, - '$1', - ); - return content.toString().replaceAll(BASE_URL_PLACEHOLDER, PUBLIC_PATH); - }, - }, - }, - ], - }), - ], + plugins: [...plugins, { apply: replaceBaseUrl }], }; } return config; diff --git a/client/package-lock.json b/client/package-lock.json index b1bb8b245..ae00bd7a5 100644 --- a/client/package-lock.json +++ b/client/package-lock.json @@ -8,7 +8,6 @@ "dependencies": { "@juggle/resize-observer": "^3.4.0", "classnames": "^2.5.1", - "copy-webpack-plugin": "^12.0.2", "date-fns": "^2.30.0", "dequal": "^2.0.3", "easymde": "^2.18.0", @@ -4941,17 +4940,6 @@ "optional": true, "peer": true }, - "node_modules/@sindresorhus/merge-streams": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/@sindresorhus/merge-streams/-/merge-streams-2.3.0.tgz", - "integrity": "sha512-LtoMMhxAlorcGhmFYI+LhPgbPZCkgP6ra1YL604EeF6U98pLlQ3iWIGMdWSC+vWmPBWBNgmDBAhnAobLROJmwg==", - "engines": { - "node": ">=18" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/@sinonjs/commons": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-3.0.1.tgz", @@ -8110,70 +8098,6 @@ "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", "integrity": "sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==" }, - "node_modules/copy-webpack-plugin": { - "version": "12.0.2", - "resolved": "https://registry.npmjs.org/copy-webpack-plugin/-/copy-webpack-plugin-12.0.2.tgz", - "integrity": "sha512-SNwdBeHyII+rWvee/bTnAYyO8vfVdcSTud4EIb6jcZ8inLeWucJE0DnxXQBjlQ5zlteuuvooGQy3LIyGxhvlOA==", - "dependencies": { - "fast-glob": "^3.3.2", - "glob-parent": "^6.0.1", - "globby": "^14.0.0", - "normalize-path": "^3.0.0", - "schema-utils": "^4.2.0", - "serialize-javascript": "^6.0.2" - }, - "engines": { - "node": ">= 18.12.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/webpack" - }, - "peerDependencies": { - "webpack": "^5.1.0" - } - }, - "node_modules/copy-webpack-plugin/node_modules/globby": { - "version": "14.0.1", - "resolved": "https://registry.npmjs.org/globby/-/globby-14.0.1.tgz", - "integrity": "sha512-jOMLD2Z7MAhyG8aJpNOpmziMOP4rPLcc95oQPKXBazW82z+CEgPFBQvEpRUa1KeIMUJo4Wsm+q6uzO/Q/4BksQ==", - "dependencies": { - "@sindresorhus/merge-streams": "^2.1.0", - "fast-glob": "^3.3.2", - "ignore": "^5.2.4", - "path-type": "^5.0.0", - "slash": "^5.1.0", - "unicorn-magic": "^0.1.0" - }, - "engines": { - "node": ">=18" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/copy-webpack-plugin/node_modules/path-type": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-5.0.0.tgz", - "integrity": "sha512-5HviZNaZcfqP95rwpv+1HDgUamezbqdSYTyzjTvwtJSnIH+3vnbmWsItli8OFEndS984VT55M3jduxZbX351gg==", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/copy-webpack-plugin/node_modules/slash": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/slash/-/slash-5.1.0.tgz", - "integrity": "sha512-ZA6oR3T/pEyuqwMgAKT0/hAv8oAXckzbkmR0UkUosQ+Mc4RxGoJkRmwHgHufaenlyAgE1Mxgpdcrf75y6XcnDg==", - "engines": { - "node": ">=14.16" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/core-js": { "version": "3.37.1", "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.37.1.tgz", @@ -26594,17 +26518,6 @@ "node": ">=4" } }, - "node_modules/unicorn-magic": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/unicorn-magic/-/unicorn-magic-0.1.0.tgz", - "integrity": "sha512-lRfVq8fE8gz6QMBuDM6a+LO3IAzTi05H6gCVaUpir2E1Rwpo4ZUog45KpNXKC/Mn3Yb9UDuHumeFTo9iV/D9FQ==", - "engines": { - "node": ">=18" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/unified": { "version": "10.1.2", "resolved": "https://registry.npmjs.org/unified/-/unified-10.1.2.tgz", diff --git a/client/package.json b/client/package.json index 1bde53ee1..4d000f747 100755 --- a/client/package.json +++ b/client/package.json @@ -61,7 +61,6 @@ "dependencies": { "@juggle/resize-observer": "^3.4.0", "classnames": "^2.5.1", - "copy-webpack-plugin": "^12.0.2", "date-fns": "^2.30.0", "dequal": "^2.0.3", "easymde": "^2.18.0", diff --git a/client/public/web.config b/client/public/web.config index ab0cf7435..860380b63 100755 --- a/client/public/web.config +++ b/client/public/web.config @@ -9,7 +9,7 @@ - +