Skip to content

📈 Open source, privacy-first web analytics — a cookie-less Google Analytics alternative with built-in error tracking and performance monitoring. Self-host it or use our cloud. Get started for free!

update deps

Blue Mouse1b807959724d
diff --git a/package.json b/package.json
index bda05dd40..87d56d67a 100644
--- a/package.json
+++ b/package.json
@@ -1,7 +1,8 @@
{
"name": "@swetrix/node",
- "version": "2.1.0",
+ "version": "3.0.0",
"description": "Swetrix NodeJS server-side tracking module",
+ "type": "module",
"main": "dist/swetrix.cjs.js",
"module": "dist/swetrix.es5.js",
"esnext": "dist/esnext/index.js",
@@ -31,20 +32,16 @@
"url": "https://github.com/Swetrix/swetrix-node/issues"
},
"homepage": "https://docs.swetrix.com",
- "dependencies": {
- "@types/node": "^20.6.0",
- "node-fetch": "^3.3.2",
- "tslib": "^2.6.2"
- },
"devDependencies": {
- "@rollup/plugin-commonjs": "^25.0.4",
- "@rollup/plugin-node-resolve": "^15.2.1",
- "@types/node-fetch": "^2.6.4",
- "rimraf": "^4.4.1",
- "rollup": "^2.79.1",
- "rollup-plugin-node-resolve": "^5.2.0",
- "rollup-plugin-sourcemaps": "^0.6.3",
- "rollup-plugin-typescript2": "^0.35.0",
- "typescript": "^5.2.2"
+ "@types/node": "^25.0.3",
+ "node-fetch": "^3.3.2",
+ "tslib": "^2.8.1",
+ "@rollup/plugin-commonjs": "^29.0.0",
+ "@rollup/plugin-node-resolve": "^16.0.3",
+ "@rollup/plugin-typescript": "^12.3.0",
+ "@types/node-fetch": "^2.6.13",
+ "rimraf": "^6.1.2",
+ "rollup": "^4.54.0",
+ "typescript": "^5.9.3"
}
}
diff --git a/rollup.config.js b/rollup.config.js
deleted file mode 100644
index 1b99a7068..000000000
--- a/rollup.config.js
+++ /dev/null
@@ -1,19 +0,0 @@
-import { nodeResolve } from '@rollup/plugin-node-resolve'
-import commonjs from '@rollup/plugin-commonjs'
-import sourceMaps from 'rollup-plugin-sourcemaps'
-import typescript from 'rollup-plugin-typescript2'
-import pkg from './package.json'
-
-export default [
- {
- input: 'src/index.ts',
- output: [
- { file: pkg.main, format: 'cjs' },
- { file: pkg.module, format: 'es' },
- ],
- plugins: [
- typescript(), nodeResolve(), commonjs(), sourceMaps(),
- ],
- inlineDynamicImports: true,
- },
-]
diff --git a/rollup.config.mjs b/rollup.config.mjs
new file mode 100644
index 000000000..65a87c9b1
--- /dev/null
+++ b/rollup.config.mjs
@@ -0,0 +1,26 @@
+import { nodeResolve } from '@rollup/plugin-node-resolve'
+import commonjs from '@rollup/plugin-commonjs'
+import typescript from '@rollup/plugin-typescript'
+import { createRequire } from 'node:module'
+import pkg from './package.json' with { type: 'json' }
+
+const require = createRequire(import.meta.url)
+
+export default [
+ {
+ input: 'src/index.ts',
+ output: [
+ { file: pkg.main, format: 'cjs', sourcemap: true, inlineDynamicImports: true },
+ { file: pkg.module, format: 'es', sourcemap: true, inlineDynamicImports: true },
+ ],
+ plugins: [
+ typescript({
+ outDir: './dist',
+ sourceMap: true,
+ tslib: require.resolve('tslib'),
+ }),
+ nodeResolve(),
+ commonjs(),
+ ],
+ },
+]
diff --git a/tsconfig.esnext.json b/tsconfig.esnext.json
index 901fb91ab..6e74fd1ec 100644
--- a/tsconfig.esnext.json
+++ b/tsconfig.esnext.json
@@ -1,17 +1,14 @@
{
"compilerOptions": {
"moduleResolution": "node",
- "target": "es2020",
- "module": "es2015",
- "lib": ["dom"],
+ "target": "ES2020",
+ "module": "ESNext",
+ "lib": ["ES2020", "DOM"],
"strict": true,
"sourceMap": true,
"declaration": true,
- "allowSyntheticDefaultImports": true,
- "experimentalDecorators": true,
- "emitDecoratorMetadata": true,
"outDir": "dist/esnext",
"typeRoots": ["node_modules/@types"]
},
"include": ["src"]
-}
+}
\ No newline at end of file
diff --git a/tsconfig.json b/tsconfig.json
index 3fe10f8db..43ed17ef6 100644
--- a/tsconfig.json
+++ b/tsconfig.json
@@ -1,17 +1,13 @@
{
"compilerOptions": {
"moduleResolution": "node",
- "target": "es5",
- "module": "es2015",
- "lib": ["es2015", "es2016", "es2017", "dom"],
+ "target": "ES2018",
+ "module": "ESNext",
+ "lib": ["ES2018", "DOM"],
"strict": true,
- "allowSyntheticDefaultImports": true,
- "experimentalDecorators": true,
- "emitDecoratorMetadata": true,
"sourceMap": true,
"declaration": false,
- "outDir": "dist/lib",
- "typeRoots": ["node_modules/@types"]
+ "allowSyntheticDefaultImports": true
},
"include": ["src"]
-}
+}
\ No newline at end of file