Fix renaming
This commit is contained in:
parent
b6d3ec940b
commit
34c8da592a
3 changed files with 7 additions and 6 deletions
|
|
@ -1,7 +1,7 @@
|
|||
import { init } from "/vendor/vendored.js";
|
||||
import { init } from "/vendor/plausible.js";
|
||||
|
||||
// Plausible analytics via the official npm tracker (@plausible-analytics/tracker).
|
||||
// server.js serves /vendor/vendored.js straight from node_modules.
|
||||
// server.js serves /vendor/plausible.js straight from node_modules.
|
||||
init({
|
||||
domain: "fizika.schmelczer.dev",
|
||||
endpoint: "https://stats.schmelczer.dev/status",
|
||||
|
|
|
|||
|
|
@ -38,10 +38,11 @@ app.use(express.json({ limit: "100mb" }));
|
|||
app.use(express.static("public"));
|
||||
|
||||
// Serve the official Plausible tracker (npm: @plausible-analytics/tracker) from node_modules.
|
||||
const plausibleTrackerPath =
|
||||
require.resolve("@plausible-analytics/tracker/vendored.js");
|
||||
const plausibleTrackerPath = require.resolve(
|
||||
"@plausible-analytics/tracker/plausible.js",
|
||||
);
|
||||
|
||||
app.get("/vendor/vendored.js", (req, res) => {
|
||||
app.get("/vendor/plausible.js", (req, res) => {
|
||||
res.sendFile(plausibleTrackerPath);
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
"description": "Static frontend for the Fizika practice app",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"vendor": "cp node_modules/@plausible-analytics/tracker/vendored.js js/vendored.js",
|
||||
"vendor": "cp node_modules/@plausible-analytics/tracker/plausible.js js/vendored.js",
|
||||
"postinstall": "npm run vendor"
|
||||
},
|
||||
"dependencies": {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue