1
0
mirror of https://github.com/teoxoy/factorio-blueprint-editor.git synced 2025-03-27 21:39:03 +02:00

remove cloudflare web analytics (will be enabled automatically by cf pages)

This commit is contained in:
teoxoy 2021-12-12 00:47:53 +01:00
parent 38f29998cd
commit 475516f31a
2 changed files with 2 additions and 13 deletions

View File

@ -93,6 +93,6 @@
</p>
</div>
<canvas id="editor" tabindex="1"></canvas>
$bundles __ANALYTICS_SCRIPT__
$bundles
</body>
</html>

View File

@ -1,4 +1,3 @@
import fs from 'fs'
import { join } from 'path'
import { fusebox, sparky, pluginLink, pluginReplace } from 'fuse-box'
import { IDevServerProps } from 'fuse-box/devServer/devServerProps'
@ -13,7 +12,6 @@ const port = Number(process.env.PORT) || 8080
const p = (p: string): string => join(__dirname, p)
const TEMPLATE_PATH = p('../src/index.html')
const HEADERS_FILE = p('../src/_headers')
const EXPORTER_DATA = p('../../exporter/data/output')
@ -34,7 +32,7 @@ class Context {
},
entry: p('../src/index.ts'),
target: 'browser',
webIndex: { template: TEMPLATE_PATH },
webIndex: { template: p('../src/index.html') },
devServer: runServer && this.getServerConfig(),
resources: {
resourcePublicRoot: '/assets',
@ -99,13 +97,6 @@ task('dev', async ctx => {
})
task('build', async ctx => {
const original = fs.readFileSync(TEMPLATE_PATH, { encoding: 'utf8' })
const mod = original.replace(
'__ANALYTICS_SCRIPT__',
`<!-- Cloudflare Web Analytics --><script defer src='https://static.cloudflareinsights.com/beacon.min.js' data-cf-beacon='{"token": "5698d7914edb4ab1bb0c61acbe3dab3d"}'></script><!-- End Cloudflare Web Analytics -->`
)
fs.writeFileSync(TEMPLATE_PATH, mod)
rm(ctx.paths.dist)
await ctx.runProd({
bundles: {
@ -116,8 +107,6 @@ task('build', async ctx => {
},
})
fs.writeFileSync(TEMPLATE_PATH, original)
await src(HEADERS_FILE).dest(ctx.paths.dist, 'src').exec()
await src(`${EXPORTER_DATA}/**/**.*`).dest(`${ctx.paths.dist}/data`, 'output').exec()