File tree Expand file tree Collapse file tree 2 files changed +22
-9
lines changed Expand file tree Collapse file tree 2 files changed +22
-9
lines changed Original file line number Diff line number Diff line change @@ -3,7 +3,9 @@ const lightCodeTheme = require('prism-react-renderer/themes/github')
3
3
const autoImportTabs = require ( './src/remark/auto-import-tabs' )
4
4
const fileExtSwitcher = require ( './src/remark/file-ext-switcher' )
5
5
6
- const includeCurrentVersion = process . env . DOCS_INCLUDE_CURRENT_VERSION === 'true'
6
+ const includeCurrentVersion =
7
+ process . env . DOCS_INCLUDE_CURRENT_VERSION === 'true'
8
+ const isProduction = process . env . NODE_ENV === 'production'
7
9
8
10
/** @type {import('@docusaurus/types').DocusaurusConfig } */
9
11
module . exports = {
@@ -213,7 +215,7 @@ module.exports = {
213
215
} ,
214
216
] ,
215
217
] ,
216
- scripts : [ '/scripts/posthog.js' , '/js/fix-multiple-trailing-slashes.js' ] ,
218
+ scripts : getScripts ( ) ,
217
219
plugins : [
218
220
'plugin-image-zoom' ,
219
221
async function myPlugin ( context , options ) {
@@ -298,3 +300,21 @@ module.exports = {
298
300
] ,
299
301
] ,
300
302
}
303
+
304
+ function getScripts ( ) {
305
+ const scripts = [
306
+ '/scripts/posthog.js' ,
307
+ '/js/fix-multiple-trailing-slashes.js' ,
308
+ ]
309
+
310
+ if ( isProduction ) {
311
+ // Using Cloudflare Workers to proxy the analytics script
312
+ scripts . push ( {
313
+ src : '/waspara/wasp/script.js' ,
314
+ defer : true ,
315
+ 'data-domain' : 'wasp-lang.dev' ,
316
+ 'data-api' : '/waspara/wasp/event' ,
317
+ } )
318
+ }
319
+ return scripts
320
+ }
Original file line number Diff line number Diff line change @@ -59,13 +59,6 @@ const Index = () => {
59
59
content = "Develop full-stack web apps without boilerplate."
60
60
/>
61
61
< meta property = "twitter:image" content = { coverPhotoAbsoluteUrl } />
62
- { /* Using Cloudflare Workers to proxy the analytics script */ }
63
- < script
64
- defer
65
- data-domain = "wasp-lang.dev"
66
- data-api = "/waspara/wasp/event"
67
- src = "/waspara/wasp/script.js"
68
- > </ script >
69
62
</ Head >
70
63
< Nav />
71
64
< div className = "min-h-screen" >
You can’t perform that action at this time.
0 commit comments