2021-07-16 08:59:46 +00:00
|
|
|
import proxy from "http2-proxy";
|
|
|
|
import path from "node:path";
|
|
|
|
|
|
|
|
const themeName = process.env.THEME_NAME ?? "keycloak";
|
|
|
|
const themePath = path.join("themes", themeName);
|
|
|
|
|
|
|
|
/** @type {import("snowpack").SnowpackUserConfig } */
|
|
|
|
export default {
|
|
|
|
mount: {
|
|
|
|
[themePath]: { url: "/", static: true },
|
|
|
|
public: { url: "/", static: true },
|
|
|
|
src: { url: "/" },
|
|
|
|
"node_modules/@patternfly/patternfly/assets/fonts": {
|
|
|
|
url: "/assets/fonts",
|
|
|
|
static: true,
|
|
|
|
},
|
|
|
|
"node_modules/@patternfly/patternfly/assets/pficon": {
|
|
|
|
url: "/assets/pficon",
|
|
|
|
static: true,
|
|
|
|
},
|
|
|
|
"node_modules/@patternfly/patternfly/assets/images": {
|
|
|
|
url: "/assets/images",
|
|
|
|
static: true,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
plugins: [
|
|
|
|
"@snowpack/plugin-postcss",
|
2022-07-09 10:22:09 +00:00
|
|
|
[
|
|
|
|
"@snowpack/plugin-webpack",
|
|
|
|
{
|
|
|
|
outputPattern: {
|
|
|
|
css: "[name].[contenthash].css",
|
|
|
|
},
|
|
|
|
extendConfig: {
|
|
|
|
output: { publicPath: "auto", path: path.resolve(".", "build") },
|
|
|
|
},
|
|
|
|
},
|
|
|
|
],
|
2021-07-16 08:59:46 +00:00
|
|
|
"@snowpack/plugin-react-refresh",
|
|
|
|
"@snowpack/plugin-typescript",
|
|
|
|
],
|
|
|
|
routes: [
|
|
|
|
{
|
2022-03-06 15:25:37 +00:00
|
|
|
src: "/admin/.*",
|
2021-07-16 08:59:46 +00:00
|
|
|
dest: (req, res) =>
|
|
|
|
proxy.web(req, res, {
|
|
|
|
hostname: "localhost",
|
|
|
|
port: 8180,
|
|
|
|
}),
|
|
|
|
},
|
|
|
|
],
|
|
|
|
devOptions: {
|
|
|
|
hmrErrorOverlay: false,
|
|
|
|
},
|
|
|
|
};
|