chore: more small work

Signed-off-by: blam <ben@blam.sh>
This commit is contained in:
blam
2023-10-02 15:51:56 +02:00
parent b3989e18a1
commit 605c0d171b
3 changed files with 1009 additions and 127 deletions
+7 -37
View File
@@ -41,43 +41,6 @@
href="<%= publicPath %>/safari-pinned-tab.svg"
color="#5bbad5"
/>
<title><%= config.getString('app.title') %></title>
<% if (config.has('app.datadogRum')) { %>
<script>
(function (h, o, u, n, d) {
h = h[d] = h[d] || {
q: [],
onReady: function (c) {
h.q.push(c);
},
};
d = o.createElement(u);
d.async = 1;
d.src = n;
n = o.getElementsByTagName(u)[0];
n.parentNode.insertBefore(d, n);
})(
window,
document,
'script',
'https://www.datadoghq-browser-agent.com/datadog-rum-v3.js',
'DD_RUM',
);
DD_RUM.onReady(function () {
DD_RUM.init({
clientToken: '<%= config.getString("app.datadogRum.clientToken") %>',
applicationId:
'<%= config.getString("app.datadogRum.applicationId") %>',
site: '<%= config.getOptionalString("app.datadogRum.site") || "datadoghq.com" %>',
service: 'backstage',
env: '<%= config.getString("app.datadogRum.env") %>',
sampleRate: 100,
trackInteractions: true,
});
});
</script>
<% } %>
</head>
<body>
@@ -93,5 +56,12 @@
To begin the development, run `yarn start`.
To create a production bundle, use `yarn build`.
-->
<script type="module">
import process from 'process';
window.process = process;
window.process.env.APP_CONFIG = window.APP_CONFIG;
</script>
<script type="module" src="../src/index.tsx" />
</body>
</html>
+7 -1
View File
@@ -163,6 +163,7 @@ export async function serveBundle(options: ServeOptions) {
if (process.env.EXPERIMENTAL_VITE) {
server = await vite.createServer({
mode: 'development',
define: {
global: 'globalThis',
APP_CONFIG: JSON.stringify(cliConfig.frontendAppConfigs),
@@ -177,7 +178,12 @@ export async function serveBundle(options: ServeOptions) {
vitePluginSvgr(),
viteCommonjs(),
viteNodePolyfills(),
htmlTemplate(),
htmlTemplate({
data: {
publicPath: config.output?.publicPath,
config: frontendConfig,
},
}),
],
server: {
host,
+995 -89
View File
File diff suppressed because it is too large Load Diff