Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add party town #740

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions main.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,24 @@
<script async src="https://unpkg.com/core-js-bundle@3.0.1/minified.js"></script>

<!-- Bundle -->
<script defer src="sentry.js"></script>
<script src="sentry.js" type="text/partytown"></script>
<script defer src="rita.js"></script>
<script defer src="main.js"></script>

<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-119249239-1"></script>
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-119249239-1" type="text/partytown"></script>

<script>
<script type="text/partytown">
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-119249239-1');
</script>
<!-- This is needed to set up forwarding for Google Tag Manager. -->
<script>
partytown = {
forward: ['dataLayer.push'],
};
</script>
<script src="~partytown/partytown.js"></script>
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
}
},
"dependencies": {
"@builder.io/partytown": "^0.5.2",
"@rollup/plugin-commonjs": "^21.0.3",
"@rollup/plugin-node-resolve": "^13.1.3",
"@sentry/browser": "^6.19.4",
Expand Down Expand Up @@ -67,6 +68,7 @@
"rita": "^2.4.91",
"rollup": "^2.36.1",
"rollup-plugin-esbuild-transform": "^1.3.2",
"rollup-plugin-serve": "^1.1.0",
"typescript": "^4.6.3",
"yauzl": "^2.10.0"
},
Expand Down
6 changes: 6 additions & 0 deletions scripts/rollup.config.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
import { Plugin, RollupOptions } from 'rollup'
// TODO: Replace this when "rollup-plugin-esbuild" fixes their sourcemap issues.
import esbuild, { Options } from 'rollup-plugin-esbuild-transform'
import serve from 'rollup-plugin-serve'
import { nodeResolve } from '@rollup/plugin-node-resolve'
import commonjs from '@rollup/plugin-commonjs'
import { partytownRollup } from '@builder.io/partytown/utils';
import path from 'path'

const env = process.env.NODE_ENV
const isProduction = env === 'production'
Expand All @@ -17,6 +20,9 @@ const sharedOptions: Options = {
}

const plugins: Plugin[] = [
partytownRollup({
dest: path.join(__dirname, 'gh-pages', '~partytown'),
}),
esbuild([
{ loader: 'json', ...sharedOptions },
{ loader: 'ts', ...sharedOptions }
Expand Down
23 changes: 23 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -668,6 +668,11 @@
resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39"
integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==

"@builder.io/partytown@^0.5.2":
version "0.5.2"
resolved "https://registry.yarnpkg.com/@builder.io/partytown/-/partytown-0.5.2.tgz#ba40369f7c0fd22169eaf6906325c150d7f77dd0"
integrity sha512-DHJPs5WPVFExUuGMsuA6yZQ6OPtVVv/3JJK9pzGrNfvuGNvlip5v7xOhXwZG26HLU9ZrrOFsOGhn5FUT2H7dPw==

"@eslint/eslintrc@^1.2.1":
version "1.2.1"
resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-1.2.1.tgz#8b5e1c49f4077235516bc9ec7d41378c0f69b8c6"
Expand Down Expand Up @@ -4289,6 +4294,11 @@ mime-types@^2.1.12:
dependencies:
mime-db "1.51.0"

mime@>=2.4.6:
version "3.0.0"
resolved "https://registry.yarnpkg.com/mime/-/mime-3.0.0.tgz#b374550dca3a0c18443b0c950a6a58f1931cf7a7"
integrity sha512-jSCU7/VB1loIWBZe14aEYHU/+1UMEHoaO7qxCOVJOw9GgH72VAWppxNcjU+x9a2k3GSIBXNKxXQFqRvvZ7vr3A==

mimic-fn@^2.1.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-2.1.0.tgz#7ed2c2ccccaf84d3ffcb7a69b57711fc2083401b"
Expand Down Expand Up @@ -4475,6 +4485,11 @@ onetime@^5.1.0, onetime@^5.1.2:
dependencies:
mimic-fn "^2.1.0"

opener@1:
version "1.5.2"
resolved "https://registry.yarnpkg.com/opener/-/opener-1.5.2.tgz#5d37e1f35077b9dcac4301372271afdeb2a13598"
integrity sha512-ur5UIdyw5Y7yEj9wLzhqXiy6GZ3Mwx0yGI+5sMn2r0N0v3cKJvUmFH5yPP+WXh9e0xfyzyJX95D8l088DNFj7A==

optionator@^0.8.1:
version "0.8.3"
resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.8.3.tgz#84fa1d036fe9d3c7e21d99884b601167ec8fb495"
Expand Down Expand Up @@ -4909,6 +4924,14 @@ rollup-plugin-esbuild-transform@^1.3.2:
dependencies:
"@rollup/pluginutils" "^4.1.1"

rollup-plugin-serve@^1.1.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/rollup-plugin-serve/-/rollup-plugin-serve-1.1.0.tgz#0654a57021a21b903340c69940f7463706e8288d"
integrity sha512-pYkSsuA0/psKqhhictkJw1c2klya5b+LlCvipWqI9OE1aG2M97mRumZCbBlry5CMEOzYBBgSDgd1694sNbmyIw==
dependencies:
mime ">=2.4.6"
opener "1"

rollup@^2.36.1:
version "2.70.1"
resolved "https://registry.yarnpkg.com/rollup/-/rollup-2.70.1.tgz#824b1f1f879ea396db30b0fc3ae8d2fead93523e"
Expand Down