-
Notifications
You must be signed in to change notification settings - Fork 232
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #452 from dasuni-30/change-vite-to-cra
Change from vite to create react app to fix the code_verfier undefined issue
- Loading branch information
Showing
10 changed files
with
136 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"baseUrl": "https://localhost:9443", | ||
"clientID": "<CONFIGURED_SPA_CLIENT_ID>", | ||
"scope": [ | ||
"openid", | ||
"profile", | ||
"email" | ||
], | ||
"signInRedirectURL": "http://localhost:3000", | ||
"signOutRedirectURL": "http://localhost:3000", | ||
"resourceServerURL": "http://localhost:9090", | ||
"myAccountAppURL": "" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
106 changes: 106 additions & 0 deletions
106
petcare-sample/b2c/web-app/petdesk/web/react/webpack.config.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
/** | ||
* Copyright (c) 2024, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. | ||
* | ||
* WSO2 Inc. licenses this file to you under the Apache License, | ||
* Version 2.0 (the "License"); you may not use this file except | ||
* in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
|
||
require("dotenv").config(); | ||
const HtmlWebpackPlugin = require("html-webpack-plugin"); | ||
const path = require("path"); | ||
const { findPort } = require("dev-server-ports"); | ||
|
||
const HOST = process.env.HOST || "localhost"; | ||
const DEFAULT_PORT = process.env.PORT || 3000; | ||
const devServerHostCheckDisabled = | ||
process.env.DISABLE_DEV_SERVER_HOST_CHECK === "true"; | ||
const https = process.env.HTTPS === "true"; | ||
|
||
const generatePortInUsePrompt = () => { | ||
return `Be sure to update the following configurations if you proceed with the port change. | ||
1. Update the "PORT" in ".env" file in the app root. | ||
2. Update the signInRedirectURL & signOutRedirectURL in "src/config.json". | ||
3. Go to the Asgardeo console and navigate to the protocol tab of your application: | ||
- Update the Authorized Redirect URL. | ||
- Update the Allowed Origins. | ||
`; | ||
}; | ||
|
||
module.exports = async () => { | ||
const PORT = await findPort(DEFAULT_PORT, HOST, false, { | ||
extensions: { | ||
BEFORE_getProcessTerminationMessage: () => { | ||
return generatePortInUsePrompt(); | ||
}, | ||
}, | ||
}); | ||
|
||
return ({ | ||
devServer: { | ||
static: path.resolve(__dirname, "dist"), | ||
historyApiFallback: true, | ||
server: https ? "https": "http", | ||
host: HOST, | ||
allowedHosts: devServerHostCheckDisabled ? "all" : undefined, | ||
port: PORT, | ||
}, | ||
devtool: "source-map", | ||
entry: [ "./src/app.tsx" ], | ||
mode: "development", | ||
module: { | ||
rules: [ | ||
{ | ||
test: /\.(tsx|ts|js|jsx)$/, | ||
exclude: /node_modules/, | ||
use: { | ||
loader: "babel-loader" | ||
} | ||
}, | ||
{ | ||
test: /\.css$/, | ||
use: [ "style-loader", "css-loader" ] | ||
}, | ||
{ | ||
test: /\.(png|jpg|cur|gif|eot|ttf|woff|woff2)$/, | ||
use: [ "url-loader" ] | ||
}, | ||
{ | ||
test: /\.html$/, | ||
use: [ | ||
{ | ||
loader: "html-loader" | ||
} | ||
] | ||
}, | ||
{ | ||
test: /\.js$/, | ||
enforce: "pre", | ||
use: [ "source-map-loader" ] | ||
} | ||
] | ||
}, | ||
output: { | ||
path: path.resolve(__dirname, "dist"), | ||
filename: "[name].js" | ||
}, | ||
plugins: [ | ||
new HtmlWebpackPlugin({ | ||
template: "./src/index.html" | ||
}) | ||
], | ||
resolve: { | ||
extensions: [ ".tsx", ".ts", ".js", ".json" ] | ||
} | ||
}); | ||
}; |