2022-07-10 15:45:55 +08:00
|
|
|
const CracoLessPlugin = require("craco-less");
|
2021-03-26 23:18:24 +08:00
|
|
|
|
|
|
|
module.exports = {
|
2022-01-29 21:52:04 +08:00
|
|
|
devServer: {
|
|
|
|
proxy: {
|
2022-07-10 15:45:55 +08:00
|
|
|
"/api": {
|
|
|
|
target: "http://localhost:8000",
|
2022-02-04 20:00:40 +08:00
|
|
|
changeOrigin: true,
|
|
|
|
},
|
2022-07-10 15:45:55 +08:00
|
|
|
"/swagger": {
|
|
|
|
target: "http://localhost:8000",
|
2022-02-04 20:00:40 +08:00
|
|
|
changeOrigin: true,
|
|
|
|
},
|
2022-07-10 15:45:55 +08:00
|
|
|
"/files": {
|
|
|
|
target: "http://localhost:8000",
|
2022-02-04 20:00:40 +08:00
|
|
|
changeOrigin: true,
|
|
|
|
},
|
2022-07-10 15:45:55 +08:00
|
|
|
"/.well-known/openid-configuration": {
|
|
|
|
target: "http://localhost:8000",
|
2022-02-04 20:00:40 +08:00
|
|
|
changeOrigin: true,
|
2022-04-04 00:09:04 +08:00
|
|
|
},
|
2022-07-10 15:45:55 +08:00
|
|
|
"/cas/serviceValidate": {
|
|
|
|
target: "http://localhost:8000",
|
2022-04-04 00:09:04 +08:00
|
|
|
changeOrigin: true,
|
|
|
|
},
|
2022-07-10 15:45:55 +08:00
|
|
|
"/cas/proxyValidate": {
|
|
|
|
target: "http://localhost:8000",
|
2022-04-04 00:09:04 +08:00
|
|
|
changeOrigin: true,
|
|
|
|
},
|
2022-07-10 15:45:55 +08:00
|
|
|
"/cas/proxy": {
|
|
|
|
target: "http://localhost:8000",
|
2022-04-04 00:09:04 +08:00
|
|
|
changeOrigin: true,
|
|
|
|
},
|
2022-07-10 15:45:55 +08:00
|
|
|
"/cas/validate": {
|
|
|
|
target: "http://localhost:8000",
|
2022-04-04 00:09:04 +08:00
|
|
|
changeOrigin: true,
|
2022-08-06 23:54:56 +08:00
|
|
|
},
|
2023-10-12 00:09:47 +08:00
|
|
|
"/scim": {
|
|
|
|
target: "http://localhost:8000",
|
|
|
|
changeOrigin: true,
|
|
|
|
}
|
2022-01-29 21:52:04 +08:00
|
|
|
},
|
|
|
|
},
|
2021-03-26 23:18:24 +08:00
|
|
|
plugins: [
|
|
|
|
{
|
|
|
|
plugin: CracoLessPlugin,
|
|
|
|
options: {
|
|
|
|
lessLoaderOptions: {
|
|
|
|
lessOptions: {
|
2022-10-03 17:43:19 +08:00
|
|
|
modifyVars: {"@primary-color": "rgb(89,54,213)", "@border-radius-base": "5px"},
|
2021-03-26 23:18:24 +08:00
|
|
|
javascriptEnabled: true,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
],
|
2023-07-20 17:51:36 +08:00
|
|
|
webpack: {
|
2023-08-13 23:58:57 +08:00
|
|
|
configure: {
|
|
|
|
// ignore webpack warnings by source-map-loader
|
|
|
|
// https://github.com/facebook/create-react-app/pull/11752#issuecomment-1345231546
|
|
|
|
ignoreWarnings: [
|
|
|
|
function ignoreSourcemapsloaderWarnings(warning) {
|
|
|
|
return (
|
|
|
|
warning.module &&
|
|
|
|
warning.module.resource.includes('node_modules') &&
|
|
|
|
warning.details &&
|
|
|
|
warning.details.includes('source-map-loader')
|
|
|
|
)
|
|
|
|
},
|
|
|
|
],
|
|
|
|
// use polyfill Buffer with Webpack 5
|
|
|
|
// https://viglucci.io/articles/how-to-polyfill-buffer-with-webpack-5
|
|
|
|
// https://craco.js.org/docs/configuration/webpack/
|
|
|
|
resolve: {
|
|
|
|
fallback: {
|
|
|
|
// "process": require.resolve('process/browser'),
|
|
|
|
// "util": require.resolve("util/"),
|
|
|
|
// "url": require.resolve("url/"),
|
|
|
|
// "zlib": require.resolve("browserify-zlib"),
|
|
|
|
// "stream": require.resolve("stream-browserify"),
|
|
|
|
// "http": require.resolve("stream-http"),
|
|
|
|
// "https": require.resolve("https-browserify"),
|
|
|
|
// "assert": require.resolve("assert/"),
|
|
|
|
"buffer": require.resolve('buffer/'),
|
|
|
|
"process": false,
|
|
|
|
"util": false,
|
|
|
|
"url": false,
|
|
|
|
"zlib": false,
|
|
|
|
"stream": false,
|
|
|
|
"http": false,
|
|
|
|
"https": false,
|
|
|
|
"assert": false,
|
|
|
|
"buffer": false,
|
|
|
|
"crypto": false,
|
|
|
|
"os": false,
|
|
|
|
},
|
|
|
|
}
|
2023-07-20 17:51:36 +08:00
|
|
|
},
|
|
|
|
}
|
2021-03-26 23:18:24 +08:00
|
|
|
};
|