Skip to content

Commit

Permalink
build: remove old GH pages deploy scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
Jameskmonger committed Aug 24, 2023
1 parent c9bd29b commit 1197203
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 128 deletions.
31 changes: 0 additions & 31 deletions .github/workflows/deploy-storybook.yml

This file was deleted.

39 changes: 0 additions & 39 deletions .github/workflows/deploy-to-gh-pages.yml

This file was deleted.

58 changes: 0 additions & 58 deletions apps/web-menu/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,60 +5,6 @@ const { TsConfigPathsPlugin } = require("awesome-typescript-loader");
const CircularDependencyPlugin = require("circular-dependency-plugin");
const { DefinePlugin, EnvironmentPlugin, ProvidePlugin } = require("webpack");

const getGAScript = (id) => {
if (!id) {
return "";
}

return ` <!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=${id}" data-cookieconsent="statistics"></script>
<script data-cookieconsent="statistics">
window.dataLayer = window.dataLayer || [];
function gtag() { dataLayer.push(arguments); }
gtag('js', new Date());
gtag('config', '${id}');
</script>`;
};

// we need to inject some redirect magic if deploying to GitHub pages
const getGHPagesRedirectScript = (enabled) => {
if (!enabled) {
return "";
}

return ` <!-- Single Page Apps for GitHub Pages -->
<script type="text/javascript">
// Single Page Apps for GitHub Pages
// https://github.com/rafrex/spa-github-pages
// Copyright (c) 2016 Rafael Pedicini, licensed under the MIT License
// ----------------------------------------------------------------------
// This script checks to see if a redirect is present in the query string
// and converts it back into the correct url and adds it to the
// browser's history using window.history.replaceState(...),
// which won't cause the browser to attempt to load the new url.
// When the single page app is loaded further down in this file,
// the correct url will be waiting in the browser's history for
// the single page app to route accordingly.
(function(l) {
if (l.search) {
var q = {};
l.search.slice(1).split('&').forEach(function(v) {
var a = v.split('=');
q[a[0]] = a.slice(1).join('=').replace(/~and~/g, '&');
});
if (q.p !== undefined) {
window.history.replaceState(null, null,
l.pathname.slice(0, -1) + (q.p || '') +
(q.q ? ('?' + q.q) : '') +
l.hash
);
}
}
}(window.location))
</script>`;
};

const outDir = path.resolve(__dirname, "dist");

module.exports = {
Expand Down Expand Up @@ -105,10 +51,6 @@ module.exports = {
APP_VERSION: JSON.stringify(require("../../package.json").version),
}),
new HtmlWebpackPlugin({
templateParameters: () => ({
googleAnalyticsScript: getGAScript(process.env.GA_ID),
ghPagesRedirectScript: getGHPagesRedirectScript(process.env.GH_PAGES),
}),
scriptLoading: "blocking",
}),
new CircularDependencyPlugin({
Expand Down

0 comments on commit 1197203

Please sign in to comment.