Skip to content

Commit

Permalink
Separer gcp og fss bygg litt mer
Browse files Browse the repository at this point in the history
  • Loading branch information
LudvigHz committed Jun 13, 2024
1 parent ad86f2e commit 78b0ded
Show file tree
Hide file tree
Showing 5 changed files with 75 additions and 16 deletions.
File renamed without changes.
45 changes: 45 additions & 0 deletions index-gcp.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<!DOCTYPE html>
<html lang="no" data-hj-suppress>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="theme-color" content="#222222">
<meta name="author" content="NAV">
<meta property="og:title" content="Modia Personoversikt">
<meta property="og:site_name" content="NAV Modia Personoversikt">
<meta property="og:description"
content="Intern arbeidsflate. Brukes som personoppslag og dialogverktøy av veiledere og saksbehandlere i NAV">
<link rel="shortcut icon" href="./favicon.ico">

<slot not-environment="production">
<script src="%VITE_HODE_URL_V2%/dev/latest/dist/bundle.js"></script>
<link rel="stylesheet" href="%VITE_HODE_URL_V2%/dev/latest/dist/index.css" />
</slot>
<slot environment="production">
<script src="%VITE_HODE_URL_V2%/prod/latest/dist/bundle.js"></script>
<link rel="stylesheet" href="%VITE_HODE_URL_V2%/prod/latest/dist/index.css" />
</slot>

<script unleash toggles="modiapersonoversikt.enable-faro">
const applicationFeatureToggles = {
enableFaro: unleash && unleash["modiapersonoversikt_enable-faro"]
};
window.applicationFeatureToggles = applicationFeatureToggles;
</script>

<script type="application/javascript">
const global = globalThis;
</script>

<script type="module" src="/src/index.tsx"></script>

<title>Modia Personoversikt</title>
</head>
<body>
<noscript>
You need to enable JavaScript to run this app.
</noscript>
<div id="root"></div>

</body>
</html>
36 changes: 22 additions & 14 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,28 +11,25 @@
content="Intern arbeidsflate. Brukes som personoppslag og dialogverktøy av veiledere og saksbehandlere i NAV">
<link rel="shortcut icon" href="./favicon.ico">

<slot not-environment="production">
<script src="%VITE_HODE_URL_V2%/dev/latest/dist/bundle.js"></script>
<link rel="stylesheet" href="%VITE_HODE_URL_V2%/dev/latest/dist/index.css" />
</slot>
<slot environment="production">
<script src="%VITE_HODE_URL_V2%/prod/latest/dist/bundle.js"></script>
<link rel="stylesheet" href="%VITE_HODE_URL_V2%/prod/latest/dist/index.css" />
</slot>
<script src="%VITE_HODE_URL_V2%/latest/dist/bundle.js"></script>
<link rel="stylesheet" href="%VITE_HODE_URL_V2%/latest/dist/index.css" />

<script unleash toggles="modiapersonoversikt.enable-faro">
const applicationFeatureToggles = {
enableFaro: unleash && unleash["modiapersonoversikt_enable-faro"]
};
window.applicationFeatureToggles = applicationFeatureToggles;
<script type="application/javascript">
window.frontendlogger = { info: function(){}, warn: function(){}, error: function(){}, event: function(){}};
window.frontendlogger.appname = 'modiapersonoversikt';
</script>

<script type="application/javascript">
const global = globalThis;
</script>
<script type="application/javascript" src="/frontendlogger/logger.js"></script>

<script type="module" src="/src/index.tsx"></script>

<script>
const applicationFeatureToggles = {
};
window.applicationFeatureToggles = applicationFeatureToggles
</script>
<title>Modia Personoversikt</title>
</head>
<body>
Expand All @@ -41,5 +38,16 @@
</noscript>
<div id="root"></div>

<!-- Hotjar Tracking Code for http://navlab.no/ -->
<!--<script>-->
<!-- (function(h,o,t,j,a,r){-->
<!-- h.hj=h.hj||function(){(h.hj.q=h.hj.q||[]).push(arguments)};-->
<!-- h._hjSettings={hjid:148751,hjsv:6};-->
<!-- a=o.getElementsByTagName('head')[0];-->
<!-- r=o.createElement('script');r.async=1;-->
<!-- r.src=t+h._hjSettings.hjid+j+h._hjSettings.hjsv;-->
<!-- a.appendChild(r);-->
<!-- })(window,document,'https://static.hotjar.com/c/hotjar-','.js?sv=');-->
<!--</script>-->
</body>
</html>
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"start": "vite",
"start:dev": "VITE_MOCK_ENABLED=false vite",
"build": "vite build",
"build:gcp": "vite build --base=/ --mode dev-gcp",
"build:gcp": "BUILD_GCP=true vite build --base=/ --mode gcp && mv build/index-gcp.html build/index.html",
"upload-sourcemaps": "cross-env GIT_COMMIT_HASH=$(git rev-parse HEAD) node _scripts/upload-sourcemaps.js",
"test": "vitest",
"lint": "eslint .",
Expand Down
8 changes: 7 additions & 1 deletion vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import react from '@vitejs/plugin-react';
import vitePluginSvgr from 'vite-plugin-svgr';
import { fileURLToPath } from 'node:url';
import { viteRequire } from 'vite-require';
import { resolve } from 'node:path';

const fixNavFrontendStyle = (packages: string[]) =>
packages.map((name) => ({
Expand Down Expand Up @@ -47,7 +48,12 @@ export default defineConfig({
target: 'esnext',
outDir: 'build',
assetsDir: 'static',
sourcemap: true
sourcemap: true,
rollupOptions: {
input: {
main: resolve(__dirname, process.env.BUILD_GCP ? 'index-gcp.html' : 'index.html')
}
}
},
define: {
process: { env: {} }
Expand Down

0 comments on commit 78b0ded

Please sign in to comment.