migrate to tsup
This commit is contained in:
parent
e256d13c92
commit
c9bb14f809
5 changed files with 22 additions and 85 deletions
29
package-lock.json
generated
29
package-lock.json
generated
|
@ -2510,35 +2510,8 @@
|
||||||
"version": "0.1.3",
|
"version": "0.1.3",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@rollup/plugin-replace": "5.0.2",
|
"tsup": "7.2.0"
|
||||||
"@rollup/plugin-terser": "0.4.3",
|
|
||||||
"@rollup/plugin-typescript": "11.1.3",
|
|
||||||
"rollup": "3.28.1",
|
|
||||||
"tslib": "2.6.2",
|
|
||||||
"typescript": "5.2.2"
|
|
||||||
}
|
}
|
||||||
},
|
|
||||||
"packages/web/node_modules/rollup": {
|
|
||||||
"version": "3.28.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/rollup/-/rollup-3.28.1.tgz",
|
|
||||||
"integrity": "sha512-R9OMQmIHJm9znrU3m3cpE8uhN0fGdXiawME7aZIpQqvpS/85+Vt1Hq1/yVIcYfOmaQiHjvXkQAoJukvLpau6Yw==",
|
|
||||||
"dev": true,
|
|
||||||
"bin": {
|
|
||||||
"rollup": "dist/bin/rollup"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": ">=14.18.0",
|
|
||||||
"npm": ">=8.0.0"
|
|
||||||
},
|
|
||||||
"optionalDependencies": {
|
|
||||||
"fsevents": "~2.3.2"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"packages/web/node_modules/tslib": {
|
|
||||||
"version": "2.6.2",
|
|
||||||
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz",
|
|
||||||
"integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==",
|
|
||||||
"dev": true
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,13 +3,13 @@
|
||||||
"version": "0.1.3",
|
"version": "0.1.3",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"description": "JavaScript SDK for Aptabase: Open Source, Privacy-First and Simple Analytics for Mobile, Desktop and Web Apps",
|
"description": "JavaScript SDK for Aptabase: Open Source, Privacy-First and Simple Analytics for Mobile, Desktop and Web Apps",
|
||||||
"main": "./dist/index.js",
|
"main": "./dist/index.cjs",
|
||||||
"module": "./dist/index.mjs",
|
"module": "./dist/index.js",
|
||||||
"types": "./dist/index.d.ts",
|
"types": "./dist/index.d.ts",
|
||||||
"exports": {
|
"exports": {
|
||||||
".": {
|
".": {
|
||||||
"require": "./dist/index.js",
|
"require": "./dist/index.cjs",
|
||||||
"import": "./dist/index.mjs",
|
"import": "./dist/index.js",
|
||||||
"types": "./dist/index.d.ts"
|
"types": "./dist/index.d.ts"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -24,10 +24,7 @@
|
||||||
"homepage": "https://github.com/aptabase/aptabase-js",
|
"homepage": "https://github.com/aptabase/aptabase-js",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "rollup -c ./rollup.config.mjs",
|
"build": "tsup"
|
||||||
"watch": "rollup -c ./rollup.config.mjs -w",
|
|
||||||
"prepublishOnly": "npm run build",
|
|
||||||
"pretest": "npm run build"
|
|
||||||
},
|
},
|
||||||
"files": [
|
"files": [
|
||||||
"README.md",
|
"README.md",
|
||||||
|
@ -36,11 +33,6 @@
|
||||||
"package.json"
|
"package.json"
|
||||||
],
|
],
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@rollup/plugin-replace": "5.0.2",
|
"tsup": "7.2.0"
|
||||||
"@rollup/plugin-typescript": "11.1.3",
|
|
||||||
"rollup": "3.28.1",
|
|
||||||
"@rollup/plugin-terser": "0.4.3",
|
|
||||||
"tslib": "2.6.2",
|
|
||||||
"typescript": "5.2.2"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,38 +0,0 @@
|
||||||
import replace from '@rollup/plugin-replace';
|
|
||||||
import terser from '@rollup/plugin-terser';
|
|
||||||
import typescript from '@rollup/plugin-typescript';
|
|
||||||
import pkg from './package.json' assert { type: 'json' };
|
|
||||||
|
|
||||||
const plugins = [
|
|
||||||
terser(),
|
|
||||||
replace({
|
|
||||||
'env.PKG_VERSION': pkg.version,
|
|
||||||
preventAssignment: true,
|
|
||||||
}),
|
|
||||||
typescript({
|
|
||||||
tsconfig: './tsconfig.json',
|
|
||||||
moduleResolution: 'node',
|
|
||||||
}),
|
|
||||||
];
|
|
||||||
|
|
||||||
const cjs = {
|
|
||||||
input: './src/index.ts',
|
|
||||||
output: {
|
|
||||||
dir: './dist',
|
|
||||||
entryFileNames: '[name].js',
|
|
||||||
format: 'cjs',
|
|
||||||
},
|
|
||||||
plugins,
|
|
||||||
};
|
|
||||||
|
|
||||||
const es = {
|
|
||||||
input: './src/index.ts',
|
|
||||||
output: {
|
|
||||||
dir: './dist',
|
|
||||||
entryFileNames: '[name].mjs',
|
|
||||||
format: 'es',
|
|
||||||
},
|
|
||||||
plugins,
|
|
||||||
};
|
|
||||||
|
|
||||||
export default [cjs, es];
|
|
|
@ -1,15 +1,15 @@
|
||||||
{
|
{
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"target": "ES5",
|
"target": "es6",
|
||||||
"strict": true,
|
"strict": true,
|
||||||
|
"moduleResolution": "node",
|
||||||
"esModuleInterop": true,
|
"esModuleInterop": true,
|
||||||
|
"jsx": "react-jsx",
|
||||||
"baseUrl": ".",
|
"baseUrl": ".",
|
||||||
"paths": {
|
"paths": {
|
||||||
"types": ["@types"]
|
"types": ["@types"]
|
||||||
},
|
},
|
||||||
"declaration": true,
|
"declaration": true,
|
||||||
"declarationDir": "./dist",
|
"declarationDir": "./dist"
|
||||||
"rootDir": "./src"
|
}
|
||||||
},
|
|
||||||
"include": ["./"]
|
|
||||||
}
|
}
|
||||||
|
|
10
packages/web/tsup.config.ts
Normal file
10
packages/web/tsup.config.ts
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
import { defineConfig } from 'tsup';
|
||||||
|
|
||||||
|
export default defineConfig({
|
||||||
|
entry: ['src/index.ts'],
|
||||||
|
format: ['cjs', 'esm'],
|
||||||
|
dts: true,
|
||||||
|
splitting: false,
|
||||||
|
sourcemap: true,
|
||||||
|
clean: true,
|
||||||
|
});
|
Loading…
Add table
Add a link
Reference in a new issue