Skip to content

Commit

Permalink
Adjust the web.config to be path independent
Browse files Browse the repository at this point in the history
  • Loading branch information
emmguyot committed Jul 20, 2024
1 parent 680b61b commit 9fb10c7
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 111 deletions.
2 changes: 1 addition & 1 deletion client/.env
Original file line number Diff line number Diff line change
@@ -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/
3 changes: 3 additions & 0 deletions client/README.md
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
# Planka client

IIS install
The build package for IIS requires URL rewrite module [https://www.iis.net/downloads/microsoft/url-rewrite]
22 changes: 1 addition & 21 deletions client/config-overrides.js
Original file line number Diff line number Diff line change
@@ -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';

Expand Down Expand Up @@ -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;
Expand Down
87 changes: 0 additions & 87 deletions client/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion client/public/web.config
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
</conditions>
<action type="Rewrite" url="BASE_URL_PLACEHOLDER" />
<action type="Rewrite" url="{.}" />
</rule>
</rules>
</rewrite>
Expand Down

0 comments on commit 9fb10c7

Please sign in to comment.