~udia/udia.ca

c5601b389d1bdcff6554a526d698aae62f661277 — Alexander Wong 2 months ago cfe0227 master
disable js bundle, move all deps to devdeps (static site) html/css only in prod
6 files changed, 6 insertions(+), 34 deletions(-)

M _config.yml
D functions/analytics.ts
M package.json
M themes/candid/layout/layout.ejs
D tsconfig.json
M yarn.lock
M _config.yml => _config.yml +1 -2
@@ 155,9 155,8 @@ filter_optimize:
    # minify all js files
    minify: true
    # bundle loaded js files into one
    bundle: true
    bundle: false
    excludes:
      - '/analytics'
  # set the priority of this plugin,
  # lower means it will be executed first, default of Hexo is 10
  priority: 12

D functions/analytics.ts => functions/analytics.ts +0 -5
@@ 1,5 0,0 @@
// Cheeky way of getting around ad blockers?
export const onRequest = async (_context) => {
  // const { data, env, next, params, request, waitUntil } = context;
  return fetch('https://static.cloudflareinsights.com/beacon.min.js')
}

M package.json => package.json +4 -8
@@ 12,20 12,16 @@
  "hexo": {
    "version": "5.4.0"
  },
  "dependencies": {
  "devDependencies": {
    "hexo": "^5.3.0",
    "hexo-browsersync": "^0.3.0",
    "hexo-generator-archive": "^1.0.0",
    "hexo-generator-category": "^1.0.0",
    "hexo-generator-tag": "^1.0.0",
    "hexo-math": "^4.0.0",
    "hexo-optimize": "^2.5.1",
    "hexo-renderer-ejs": "^1.0.0",
    "hexo-renderer-marked": "^4.1.0"
  },
  "devDependencies": {
    "@cloudflare/workers-types": "^3.2.0",
    "hexo-browsersync": "^0.3.0",
    "hexo-server": "^2.0.0",
    "typescript": "^4.5.2"
    "hexo-renderer-marked": "^4.1.0",
    "hexo-server": "^2.0.0"
  }
}

M themes/candid/layout/layout.ejs => themes/candid/layout/layout.ejs +1 -1
@@ 6,6 6,6 @@
    <section id="main"><%- body %></section>
    <%- partial('_partial/footer', null, {cache: !config.relative_link}) %>
  </div>
  <script defer src='/analytics' data-cf-beacon='{"token": "70955f29972649bfac0febeb3d6ffee9"}'></script>
<script defer src='https://static.cloudflareinsights.com/beacon.min.js' data-cf-beacon='{"token": "70955f29972649bfac0febeb3d6ffee9"}'></script>
</body>
</html>
\ No newline at end of file

D tsconfig.json => tsconfig.json +0 -8
@@ 1,8 0,0 @@
{
    "compilerOptions": {
      "target": "ES2020",
      "module": "CommonJS",
      "lib": ["ES2020"],
      "types": ["@cloudflare/workers-types"]
    }
}

M yarn.lock => yarn.lock +0 -10
@@ 2,11 2,6 @@
# yarn lockfile v1


"@cloudflare/workers-types@^3.2.0":
  version "3.2.0"
  resolved "https://registry.yarnpkg.com/@cloudflare/workers-types/-/workers-types-3.2.0.tgz#df300466f5f8a03b205bdd533990017b0538496e"
  integrity sha512-y0+f7QeB5/fMMdU0wSwvBB18yE9kAD2s7Wben8a4uI4f/EJyE+eJrai5QO52Pq8EmWP0vRpKqZh0qU857WhY2A==

"@tootallnate/once@1":
  version "1.1.2"
  resolved "https://registry.yarnpkg.com/@tootallnate/once/-/once-1.1.2.tgz#ccb91445360179a04e7fe6aff78c00ffc1eeaf82"


@@ 2121,11 2116,6 @@ type-check@~0.3.2:
  dependencies:
    prelude-ls "~1.1.2"

typescript@^4.5.2:
  version "4.5.2"
  resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.5.2.tgz#8ac1fba9f52256fdb06fb89e4122fa6a346c2998"
  integrity sha512-5BlMof9H1yGt0P8/WF+wPNw6GfctgGjXp5hkblpyT+8rkASSmkUKMXrxR0Xg8ThVCi/JnHQiKXeBaEwCeQwMFw==

ua-parser-js@1.0.2:
  version "1.0.2"
  resolved "https://registry.yarnpkg.com/ua-parser-js/-/ua-parser-js-1.0.2.tgz#e2976c34dbfb30b15d2c300b2a53eac87c57a775"